How do I Position HUD with Scroll to on Character

Get help using Construct 2

Post » Mon Jul 28, 2014 9:03 am

ok so for my game i have these specs:
layout size: 2240, 1280
window size: 960, 640

Have setup my level where the character starts in the bottom left corner and he eventually works his way right and then up around back to the start(like a snake going counter clockwise)

The view set to scroll to on my player so he is always in the middle of the screen.
I have setup a hud on the first layer(5th so not really first :P) and tried a few different things to get it to work;
Paralax set to 0, 0 set items on top of screen just below where i see the top of the game window when testing, and I dont see the hud items.

Paralax set to 0, 100 I now see the hud items where I had them placed at the top of game window(not the top of the level) but the hud items do not scroll up when the players is moving up in the level.

set the paralax to 0, 10 with object behaviors bound to layout and still no dice they hud will not scroll up with the player !

TLDR; Cannot get my hud to move up the screen when the player is moving up and forcing the screen to follow.
Last edited by kepoly on Mon Jul 28, 2014 9:31 am, edited 1 time in total.
B
9
S
1
Posts: 18
Reputation: 515

Post » Mon Jul 28, 2014 9:11 am

Hi,
Normally you just need to create a layer above the layer your player is and to set the Paralax to '0,0' and playe your elements at the left side of the layout (note your windows size)

It works fine for me, check out this HTML5 demo and tell me if this is what you want ;)
http://envato.wdbase.de/wp-content/demo/candyland/

Then I can show you the setup.
Image Image iTunes: Match3 | Google Play: Match3
B
100
S
35
G
30
Posts: 1,136
Reputation: 28,085

Post » Mon Jul 28, 2014 9:13 am

Set the paralax to 0,0

put the hud elements within the dotted line in your editor..
The dotted line is your original viewport..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Jul 28, 2014 9:17 am

Is there a way to change the original viewport?
B
9
S
1
Posts: 18
Reputation: 515

Post » Mon Jul 28, 2014 9:31 am

Was thinking way to hard at this one sorry..
Your right all i had to do was put the elements in the dotted lines even though that's not where it started when viewing the game(obviously)
B
9
S
1
Posts: 18
Reputation: 515

Post » Mon Jul 28, 2014 3:05 pm

It's easy to overthink this stuff.
Phase 1: Collect Underpants.
Phase 2: ????
Phase 3: Profit!
B
16
S
5
G
4
Posts: 106
Reputation: 2,450

Post » Mon Jul 28, 2014 3:51 pm

@kepoly

Aside from separate layer + parallax(0,0) already mentioned, you might want to give the HUD elements the Anchor behaviour so that they maintain their position relative to the edges when scaling to device resolution.
Find all the Construct 2 games that were on Steam Greenlight here
B
33
S
9
G
7
Posts: 451
Reputation: 6,782


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 28 guests