Placement of sprites outside the layout.

Just started using Construct 2? Post your questions here

Post » Fri Apr 04, 2014 5:34 pm

Hey all,
I have tutorial capx on menu button animation, as in how to bring the buttons in and out of the screen. Say i want the button's Y coordinate to be 500 at all times with varying X as it moves into the screen. So in the capx, it has an 'on start of layout' event giving an action to place the sprite at (for example) X:1000(outside screen),Y:500. So i would only need an event that varies the X coordinate to the desired value to bring it into the screen rather than having to bother with the Y coordinate as well.

I want to know if the 'on start of layout - place sprite in x, y' event is necessary. I mean i could just manually place the sprites on X:!000,Y:500 on the layout and i would not need that event.Every time i run,the sprites would be where i put them. If i didn't bother with having that on start of layout event would it affect the sprite's position on the layout if i exported the project to mobile platforms?.
B
16
S
4
Posts: 138
Reputation: 1,454

Post » Sun Apr 06, 2014 12:01 am

I can't imagine why it would matter, but you could always have it there and then have an event move it just in case.
B
8
S
1
Posts: 76
Reputation: 949

Post » Sun Apr 06, 2014 12:11 pm

Most people put them just outside somewhere manually and be done with it.

However there is one distinct advantage of placing the starting position procedurally: If you have varying screen sizes (for example if you cover desktop and mobile aspect ratios within the same game) and you always want to start the button from say: 100 pixels right of your window, it's better to place them with an event.
A possible reason for wanting that (and not just put them somewhere the window will never reach them, like 10000 or so) could be that you want the button to appear at the same time on all platforms and screen ratios. If it was far out, it might be a couple of seconds until it becomes visible, depending on how everything is set up.

So if it matters or not - it all depends on your project and what you need it to do.
B
72
S
28
G
32
Posts: 477
Reputation: 19,640


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests