dim3 Forum

Full Version: Scaling overall size of choosers
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I got a problem with choosers. In 2.5 b8 there seem to be two places for HUD/interface scaling, the Game.js with

Code:
iface.screen.widthScale=1024;
    iface.screen.heightScale=640;


and the Interface.xml with

Code:
<Scale x="1024" y="640" />


In my game both are set to 1024x640. While the former seems to influence the HUD scaling, the latter seems to have an impact on scaling of the start up menu, the in game menu and choosers.

However, increasing the scaling in Interface.xml from 640x480 to 1024x640 kept the overall chooser size the same, while the chooser was pushed to the upper left.

Here some comparison screens. Since F4 for screenshots only seems to work in game, but not in a menu (request!!), some shots taken with my phone:


vs



What I request / like to know is how to keep the choser the same size relative to the overall screen, while adding more pixels inside scaling up the interface. The font should then scale accordingly (which it does not right now, see screen).

Yup, that scale factor is brand new -- it's to allow you easier (no script) way to scale up the interface, and also there will be additions to support wide screen resolutions.

I'd erase the one in the script and just use the one in the interface. Once you have the one set in the interface, what that does is set the size of the screen that you draw interface elements to. This is NOT effected by the users resolution.

So, if you set the size to something like 1000x750 (which is something I'll do in my new demo whenever I get to it), set all elements with the impression of that size.

i.e., pick one and stick with it, that'll be the native resolution for interface items. The game will auto-scale them up to be whatever the resolution of the user is.

So, if you set 1024x640 (remember, these aren't resolution so it might be easier to set it to more understandable numbers, like 1000x750) .... you would make a chooser that took up the whole screen with a 10 border by setting it to:

x=10
y=10
width=1004
height=620

In the future (in 2.5, when I get that far) there will be a wx/wy/etc for all items, which will be a second set of coordinates for wide screen resolutions (i.e., not 0.75 resolutions.) Don't have those yet.

[>] Brian
Also note that this isn't quite finished yet, and it'll mess up a couple hard-set interface things if you aren't using the default 640x480. This is something that will be fixed.

[>] Brian

ggadwa Wrote:
x=10
y=10
width=1004
height=620
[>] Brian


Uhm, where would I set these?

Bradamante Wrote:

ggadwa Wrote:
x=10
y=10
width=1004
height=620
[>] Brian


Uhm, where would I set these?


Oh, sorry, right now the chooser selects the size of the dialog by finding the farthest left/right/top/bottom items, I could see that causing problems in the future, so for the next version I'll add the ability to set the size of the chooser dialog, that will help fix this for you.

[>] Brian

Tried a few things and run into trouble.

I have a 1680x1050 screen, I'd like to have a 1024x640 chooser inside of it.

So, the target look is something like:


Both in Game.js and Interface.xml I set 1024x640 as scaling factor (deleting one of those screws things up - 2.5 b8).

Here is the markup from the Interface.xml for that chooser:
<Chooser name="PlanetChooser">
<Texts>
<Text id="5010000" data="Hathasar IV" x="200" y="16" just="center" large="false" clickable="false" />
</Texts>
<Items>
<Item id="5010100" file="snow_sunset688x256" x="32" y="80" clickable="false" />
<Item id="5010101" file="bar240x32" x="32" y="368" clickable="true" />
<Item id="5010102" file="missions240x32" x="32" y="416" clickable="true" />
<Item id="5010103" file="trade240x32" x="32" y="464" clickable="true" />
<Item id="5010104" file="shipyard240x32" x="752" y="368" clickable="true" />
<Item id="5010105" file="outfit240x32" x="752" y="416" clickable="true" />
<Item id="5010106" file="refuel240x32" x="752" y="464" clickable="true" />
<Item id="5010107" file="exit240x32" x="752" y="576" clickable="true" />
</Items>
</Chooser>

This is what I get right now in engine:


What I find interesting is that the Demo chooser displays correctly, a 640x480 chooser inside the 1680px screen. But obviously my chooser is blown up. The cancel button is out of reach, a force quit necessary.

Besides the fill screen issue I see the buttons pushed tight to the border. I defined a x=32 for the outer buttons, but it looks like half of it.

EDIT:

Tested both Demo chooser and my chooser @ scaling factor 1680x1050:



Thanks, I'm going to try to get some work on this for the next version, right now I'm adding:

1) ability to set the frame if you want it
2) default buttons (set a button for return, a button for esc)
3) any fixes in the scaling

It might not be perfect but I'll get it into shape over the course of the releases.

[>] Brian
Also, the other problem is wide screens vs standard screens. 640x480 is standard, you 1680x1050 is widescreen. I'm working out a solution for this.

[>] Brian
Reference URL's