Bottom of Window HUD Scaling Issues

0 favourites
  • 5 posts
  • So I'm having some trouble with making a HUD for my game. I'm trying to go for a retro look, so I'm creating my sprites at tiny sizes and then setting the game to Fullscreen Scale mode and point sampling, while also having my window size set at 320x240. This works pretty swell for everything except putting the HUD at the bottom of the screen.

    As the window's height grows larger, the HUD elements on the bottom of the screen go further and further down off the screen. They don't want to stay on. I've got my HUD layer set to Parallax 0, 0, and I've tried giving both of the HUD objects the Anchor behavior, and I also have it programmed to set the object positions to "window height - hud obj height", but to no avail. Putting the layer's Scale to 0 keeps the HUD onscreen, but obviously doesn't scale it along with the rest of the game and so does me no good.

    Another thing I've noticed is that everything is lined up perfectly as long as the height is at the default 240 height and greater than the default 320 width, but any smaller and the positioning and scaling get thrown way off. Setting the browser into fullscreen mode changes nothing.

    Any HUD elements in the top left of the screen with the Anchor behavior seem to work fine for whatever reason, as evidenced by the text displaying the current window height in the following capx.

    I don't know if this is a bug or not, but it's certainly cramping my style, especially since the HUD would look real awkward on the top of the screen.

    Problem Capx!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I can't open your capx because I don't have all those plugins installed, but try to use 320 and 240 instead of WindowWidth and WindowHeight.

  • No dice! <img src="smileys/smiley19.gif" border="0" align="middle" /> I actually tried that before. What it does instead of going down off screen, it goes UP off screen. How bizarre.

  • When using Fullscreen(scaled) I don't find the WindowWidth and WindowHeight expressions enough to position objects to the edge of a 0,0 parallax layer.

    The solution is to use the Anchor behavior. But since your events indicate you don't want to have to recreate the HUD per layout make the hud objects global and position them on your startup layout. Then they just need to be moved to the HUD layer per layout with events.

  • Well that works brilliantly for the HUD! Thanks so much!


    Unfortunately this means I have to figure out how to streamline my message windows again. Not a huge huge deal, but if the Anchor object had some way of changing the anchor positions midgame it'd be infinitely easier. But that's for another thread methinks.

    Thanks again so much R0J0!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)