OpenApoc
OpenApoc copied to clipboard
Form borders are strange
Some forms have a minsize of 640x480 but size of 646x484 and have a border of 2x2. Some don't. This looks good right now with form having a border, but what if a user wants to play fullscreen 640x480? It will still have a border! And user will see topleft border and miss 2px of the form content in the bottom right.
I propose to figure some way to change all forms to be 640x480, and add border in some other way (like, display a border under form if some tag is present on the form?)
It might have changed from when I first wrote all the forms, but those ones were generally display aligned to the centre of the screen. This means on a 640x480 display the borders would just disappear, and the game would appear as normal; in in larger displays, it has a nice border to just help break the form from what was behind.
I'm not sure why you'd want a border in the native resolution, as the form fills the screen, and thus does not need "breaking" from any other content.
erm do the forms actually align to center and thus borders go outside the screen? I thought that the form itself would position at center of screen but the form contents would not.
but if they do then it's good, the only problem that remains is that coordinates on forms are inconsistent (like, OK button is always in the same place, however, if form has border then it's 2 pixels to the bottom right).
https://github.com/OpenApoc/OpenApoc/blob/master/data/forms/mainmenu.form#L5
Can you show me an example of your inconsistant co-ordinates? Because all co-ordinates are relative to the parent control.
So an OK and the bottom right of the 640x480 screen will still be in the same position on a higher resolution, but still within that 640x480 block, which is centre aligned inside the 644x484 block, which is centre aligned to the screen.
If you can visually show me where there's inconsistancy due to a different screen resolution, I'll take a look, but I don't see how
What I mean is that when writing .form files, you have to write different coordinates for OK buttons for forms that are with border and those without. They both display properly but it's not as convenient to copy repeating controls between forms as you have to adjust
Can you point me to an example? Because I'm not sure I'm understanding you properly.
Controls in the Forms system are hierarchical. So the "border" control will (should?) only have one child control, which is usually a [graphic] object for the background image. All the buttons should be children of the graphic object, which means it's irrelevant if the form has a border or not.
The only reason I can see there being a need for slightly different offsets is to match to the origin PCX background images of the game.