How do I Lock a layer to screen regardless of size?

Just started using Construct 2? Post your questions here

Post » Tue May 17, 2016 12:16 am

So I added a layer with "buttons", (Walk left right jump)

If I make the size of the play window very small, lets say I then jump, the game will follow with camera on the hero so screen goes up a bit, and buttons stay at their same place, is there a way to make so the layer with buttons always is on screen (And not locked to their place?)
B
21
S
9
G
8
Posts: 188
Reputation: 6,069

Post » Tue May 17, 2016 4:53 am

set the parallax properties of the layer to 0,0
B
47
S
22
G
65
Posts: 1,127
Reputation: 38,395

Post » Tue May 17, 2016 10:04 am

Prominent wrote:set the parallax properties of the layer to 0,0


Image

My buttons disappear when I did that?
B
21
S
9
G
8
Posts: 188
Reputation: 6,069

Post » Tue May 17, 2016 1:19 pm

Here

http://www59.zippyshare.com/v/Vlw0GyPg/file.html

Mouse click on the A button and the sprite will move with button locked into steady position.
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 682
Reputation: 16,615

Post » Tue May 17, 2016 6:26 pm

Make sure their positions are relative to the top left of the layout, and fit within the window area. If your window area is dynamic, you'll need to get the window size at the start of the layout in the events and set their positions to be within those boundaries.
B
47
S
22
G
65
Posts: 1,127
Reputation: 38,395

Post » Tue May 17, 2016 7:50 pm

@Triforce did you download the sample I made and try it?
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 682
Reputation: 16,615

Post » Tue May 17, 2016 10:11 pm

PixelPower wrote:@Triforce did you download the sample I made and try it?


I have not sorry
B
21
S
9
G
8
Posts: 188
Reputation: 6,069


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests