Resizing and moving the Map
Pykrete
07 Jul 2016, 11:33Hi there!
I'm currently making use of the Map feature, and I think I've gotten all the kinks ironed out; except one.
Currently, it sits at the top of the screen taking up a pretty disgusting amount of space. It doesn't even fully cover the top of the screen, though; you can see slivers of words that have been pushed up that far underneath it to the left, as show here.
https://i.gyazo.com/bdc4998a32ade8d224aa836cbae3d427.png
Now, on the right of my screen with all the status stuff, I have some prime real estate going just under the compass. Would it be possible to resize the map window to be roughly the same size as the compass, perhaps a little bigger, and then move it down into that bar?
Thank you for any responses.
XanMag
07 Jul 2016, 22:32Calling Jay. Clean up on the map aisle. Jay, please report to the map aisle.
... Hopefully Jay can help with this. He's done some nice map work.
Pykrete
08 Jul 2016, 00:59Ha, yes, I noticed him popping up in a lot of the map question topics.
Pykrete
17 Jul 2016, 12:06Think I'm at the point where I can bump without feeling guilty.
The Pixie
19 Jul 2016, 07:57In the game.start script, use commands like this to control how things are displayed:
JS.eval("$('#gridPanel').css('margin-left', '-800px');")
"gridPanel" is an HTML element that contains the map, "gridCanvas" is the other. You will need to adjust the properties of one or the other or both. In the example, "margin-left" is the name of the property, and "-800px" is the value it is set to. Other properties that are important are "left", "top", "height" and "width".
You can see the current values in the off-line editor by clicking on "HTML Tools" whilst the game is running, and expanding the sections listed (look in html, body, gameBorder). If you are on-line you can do that through the developer tools of your browser.
I have never used the map, so cannot give any more advice thanthat, though you might find this link use for general info on changing the UI.
http://textadventures.co.uk/forum/samples/topic/5111/how-to-modify-the-user-interface
Pykrete
19 Jul 2016, 13:27Thank you Pixie, I shall take a look and see what I can some up with. I assume Height and Width will resize the map window itself?
Edit: Bleh. From what I've been able to do/see so far, even if I resize both panels and move them, the map itself doesn't move to update it. What I mean by that is the windows move, but they don't move the map itself, so it's displaying nothing but white space - the beginning of the map is still up in the top, forcing the user to click and drag the window or zoom out to try and find it. Less than ideal...
Edit edit; And when it comes to actually trying to apply these resizes and movements in the game.start script, the code is just... tempermental as hell. Sometimes it works. Sometimes half of it works. Sometimes none of it works. It's completely random.
Edit edit edit; in fact, the only thing that works at all is modifying the 'left-margin'. Trying to modify anything else in the same manner doesn't throw up any errors, but it is completely ignored. This is just frustrating beyond belief.
The Pixie
19 Jul 2016, 17:42You may need to override one or more if the grid functions (if off-line you can filter the names at the top of the left pane), and change the positioning there.