Fascinating!
I am in awe of your math skills.
The resize function is quite formidable. If I understand what's going on:
1) First, the global CurrentW and CurrentH are set to the resolution (in this case, 320x240)
2) Afterwards, a check is made to see if they are different than the DisplayWidth and DisplayHeight, and if so,
3) You set up the X and Y of the "Red" family bars using some seriously complicated math that calculates the position of the bars by having the current width and height subtracted from the base width and height(obviously it's more complicated than that though), and
4) finally, a zoom is applied that judges the difference between the base width and height and the new current width and height and zooms accordingly. Very elegant and flexible.
I wonder how the formula handles all four bars and their respective positions (unless you sort of eyeballed it?). And more importantly, how you figured all of that out! Again, I am very impressed.
[quote:27c3kc47]The formula for handling parallax would have to be repeated for different object classes. I kept it to scrolling backgrounds for simplicity. You'd need to make another family to do sprites... which... isn't really a big deal.
Do you mean the formula for the resize function?
[quote:27c3kc47]You can also use high quality, high res art for the sidebars (and maybe punch out a viewport with the erase effect) and it will show at max resolution which is pretty nice, so you can do stuff like this
Funnily enough, I was thinking about this the other night, and came up with the pseudo solution to just have a window like the image above, except native to the application and not hard-coded in - similar to what you find in old Japanese computer games.