Crop mode and Hud

Discussion and feedback on Construct 2

Post » Sun Dec 22, 2013 4:29 am

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!
B
16
S
5
G
1
Posts: 190
Reputation: 2,489

Post » Sun Dec 22, 2013 4:31 am

I'm sure you have the parallax rate right, but do you have scale on your UI layer set to 0?
B
103
S
38
G
19
Posts: 962
Reputation: 17,996

Post » Sun Dec 22, 2013 4:40 am

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.Rushino2013-12-22 04:42:04
B
16
S
5
G
1
Posts: 190
Reputation: 2,489

Post » Sun Dec 22, 2013 11:10 am

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.
Scirra Founder
B
395
S
231
G
88
Posts: 24,367
Reputation: 193,684

Post » Sun Dec 22, 2013 11:31 am

I'd set the hud X and Y to scrollx - value and scrolly - value.
B
123
S
43
G
41
Posts: 846
Reputation: 28,204

Post » Sun Dec 22, 2013 2:50 pm

You may also be able to mess around with the 'Anchor' behaviour to keep things in the right position.
B
25
S
6
G
3
Posts: 197
Reputation: 3,355

Post » Sun Dec 22, 2013 3:28 pm

[QUOTE=Ashley] 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.[/QUOTE]

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.
B
16
S
5
G
1
Posts: 190
Reputation: 2,489

Post » Sun Dec 22, 2013 3:28 pm

[QUOTE=TwinTails] You may also be able to mess around with the 'Anchor' behaviour to keep things in the right position.[/QUOTE]

Anchor seem useful for resizing only.
B
16
S
5
G
1
Posts: 190
Reputation: 2,489

Post » Sun Dec 22, 2013 3:29 pm

[QUOTE=andreyin] I'd set the hud X and Y to scrollx - value and scrolly - value.[/QUOTE]

of the hud layer ?
B
16
S
5
G
1
Posts: 190
Reputation: 2,489

Post » Sun Dec 22, 2013 5:26 pm

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!Rushino2013-12-22 17:27:00
B
16
S
5
G
1
Posts: 190
Reputation: 2,489

Next

Return to Construct 2 General

Who is online

Users browsing this forum: Refeuh and 10 guests