Crop mode and Hud

0 favourites
  • 10 posts
From the Asset Store
Use this epic life system with hearts like famous games in your game!
  • Hi there.

    Is there a way to make the HUD stay at the same place with scrolling on while changing the layout scale rate.. from 1 to 2 to 3, etc.

    It seem like the X and Y position when scalling up are changing. I am using crop mode so i am handling myself the scalling but the HUD just doesn't stay in place. What i am doing wrong ?

    Thanks! Your help are greatly appreciated!

  • I'm sure you have the parallax rate right, but do you have scale on your UI layer set to 0?

  • Mmm.. if i do this the UI won't scale up if the layout is scaled up. Also i have Unbounded Scrolling to YES which complicate things a bit.

  • I wouldn't use crop mode. It's not really that useful, since it leaves you to solve problems like this by yourself. If you use one of the other fullscreen modes, everything gets scaled for you.

  • I'd set the hud X and Y to scrollx - value and scrolly - value.

  • You may also be able to mess around with the 'Anchor' behaviour to keep things in the right position.

  • I wouldn't use crop mode. It's not really that useful, since it leaves you to solve problems like this by yourself. If you use one of the other fullscreen modes, everything gets scaled for you.

    I disagree there. So far it was really useful.. until it won't lets me positionate stuff. lol This have to do with the layer viewport which are moving somehow. So yeah i probably have to figure out myself the positionning but i am pretty sure i will end up hardcoding the stuff since i can't do anything automatic.

    Everything would get scaled up but at integer value since its a pixel art game.. so that leave the game with huge black bar. Not very interesting for the end user. Setting the WindowsSize at startup by events would solve a lots of theses problems cause i would simply choose the best option based on user desire.

  • You may also be able to mess around with the 'Anchor' behaviour to keep things in the right position.

    Anchor seem useful for resizing only.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'd set the hud X and Y to scrollx - value and scrolly - value.

    of the hud layer ?

  • Found something interesting. If you scale you have to wait around 1 sec before positionning the HUD otherwise it won't work or always set the positionning at each tick (but i am pretty sure it would cause some performance loss)

    So what i do is having 2 variable which is LastViewportLeft and LastViewportTop. The first time i set thoses variable to current view ports. Then i detect if the viewport changed and repositionate the HUD based on the new viewport. Work like a charm!

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