If the following is true then that's exactly what I've been looking for:

That IS definitely true, I've played around ex_resize2.exe in the allegro examples and if you fail to acknowledge the resize event (commenting the proper code) you see the picture that gets resized (automagically transformed) proportionally.

Althou this means that I see in your video means you're NOT acknowledging the resize.

Which could be what you were looking for, if you don not want to clip the graphics but would like to have the screen automatically re-proportioned.

In that case, you WILL have to transform the mouse input, but to get the resized coordinates you have to look in the EVENT struct fields, namely:

outer_area is your screen, layout_area is the percentage rectangle, and LayoutArea returns the new rectangle based on the combination of the two.fx,fy,fw,and fh are all floats representing the percentage from 0 to 1.0 (or beyond, but then offscreen) of that dimension's x or y or w or h.

Really, you should check to make sure you're transforming your buttons to the new position properly. All I saw was += fx + ... which is just a translation, and not a scaling.

Before, I was making the mistake of assuming the instant resizing of the graphics within the window when adjusting the window size via the mouse, to be what al_acknowledge_resize() actually does

Now I just need to transform the fonts and bitmaps (perhaps all put onto one bitmap first, not quite sure yet) to match the new size as it's acknowledged. Also I now have the values to compensate for the mouse collision detection.

Interesting though. I'm left wondering if some people simply use the instant resizing of the graphics as usable for one of their display modes, as after all it does seem to work okay, as seen from my first video, but there's no values to use for compensating for the mouse issue I've was having, as I know all too well. Also I'm suspecting the graphics are only intended as a preview or even abandoned data which just happens to stay in tack enough to form an okay image, although it does seem to break up slightly irregular at points as the widow changes size, but this mostly seems to only distort the text.

Whether you are or not, I'm still extremely happy because now I understand

More About This: If I store the mouse position values instantly before ALLEGRO_EVENT_DISPLAY_RESIZE starts, and then compare them the instant ALLEGRO_EVENT_DISPLAY_RESIZE stops, then I should have the correct values to compensate for the mouse. Along with the above is this along the lines of what you mean.

The main disadvantage of the resolution independence methods you linked is that your game can only run on 1 aspect ratio. If you want your game to run on 4:3,16:9,16:10 aspect ratios etc, then you will have to have black borders or everything will look stretched.

Yes, the other option involves using layouts / relative size algorithms for your gui, and for the game, you can use transformations such that the character is always the same size, but more land is in view in widescreen and so forth. My game supports just about any common aspect ration because of how I designed it.

The basic idea of layouts is that you specify constraints for your widgets/components. You put Widgets into containers with these constraints and the algorithm will size and position your Widgets such that they look optimal for the selected width and height.

Java's Swing API allows this sort of flexibility. My GUI API and a few other GUI APIs on a.cc support this sort of Layout concept.

Otherwise, the alternative quick n dirty way is for you to specify when you get a resize event:button1.size = width * 0.2f, 60;button1.location = width / 2, height / 2;

So basically, when the screen is resized, set the button to the center of the screen, and set its width 20% of the screen width, and its height to a fixed 60 pixels.

This way at any resolution the button will look correct.

It's a lot more work to do it this way but I personally prefer it over a static solution.

Before, I was making the mistake of assuming the instant resizing of the graphics within the window when adjusting the window size via the mouse, to be what al_acknowledge_resize() actually does

If you run both allegro examples ex_resize and ex_resize2 you might end up thinking that, since both programs resize what's in the screen automatically; this led me to the initial confusion because clashed with what jamsterx said (and I actually remebered like that as well).

Upon looking at the code of the examples thou it was clear that's not the case.

Dunno, maybe the two examples could be tinkered with.

moving on...

Quote:

pkrcel are you saying my suggestion of using the instant resizing of the display might be a valid option

Not exactly, because I don't know what are you aiming for specifically, but in principle if you're not bothered by the shrinking/stretching you indeed COULD use the automatic gfx adaptation.

It's not elegant nor eyecandy thou, you should at least set display constraints that set for a minimum and maximum width/height (see al_set_window_constraints), and could even handle the resize event (still without acknowledging) calling al_resize_display to FORCE a certain aspect ratio.

At least that's how it come to mind seeing your video, which admittedly it's not the optimal way to do it (I dunno if the gfx driver performance would be bothered for example, even thou I guess not).

It is unlikely that Google shares your distaste for capitalism. - DerezoIf one had the eternity of time, one would do things later. - Johan Halmén

Felt obligated to mention this - the way the display looks during a resize is just a temporary way to keep something on the screen that looks remotely appropriate. The mouse and its positions will NOT be affected until you call al_acknowledge_resize or al_resize_display. Then they should work as expected. Allegro does not transform the mouse. It just stretches the display to the intermediate size.