Create a slide-in menu

Get help using Construct 2

Post » Fri Oct 18, 2013 5:05 pm

Hey there,

I'am new at working with construct. My question is, how I can greate a menu which is sliding in when i press a button. This is not that difficult. But i want to rotate the button 180(arrow) and if someone press this button again, the menu will silde back out of the layout.

It would be great if some could help me out with an easy example! Thanks a lot!
Image Image iTunes: Match3 | Google Play: Match3
B
98
S
33
G
30
Posts: 1,124
Reputation: 27,805

Post » Fri Oct 18, 2013 6:14 pm

Probably pin the objects (pin behavior) that make up the menu to a sprite (menu background for example) and only move this one sprite in and out.
Dunno what you mean with the button. You can use an instance or global variable to check whether it should spin or not.mindfaQ2013-10-18 18:15:18
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Fri Oct 18, 2013 6:40 pm

Thanks for your respone.

If i press this button
Link to picture 1
I should open the side menu and slide in like on this picture.

Link to picture 2
How you can see the button rotate 180. Now i if I press this button again, i should be slide out and look like the picture 1. Sorry its difficult to explain for me in englisch..

I hope you know what i mean. Maybe you can help me out with a example file. Thanks!
Image Image iTunes: Match3 | Google Play: Match3
B
98
S
33
G
30
Posts: 1,124
Reputation: 27,805

Post » Fri Oct 18, 2013 7:25 pm

here:
http://s000.tinyupload.com/index.php?file_id=11083207732166632627

edit:
sry, the first version has inconsistencies with the angle.
This fixes it:
http://s000.tinyupload.com/index.php?file_id=32567645145203580508mindfaQ2013-10-18 19:31:20
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Fri Oct 18, 2013 7:42 pm

mindfaQ was faster... but I've done an example too ^^

Menu-SlideIn.capx
B
21
S
8
G
7
Posts: 49
Reputation: 5,274

Post » Fri Oct 18, 2013 8:16 pm

Awesome! Big thanks to both of you! Now it works perfectly! :)
Image Image iTunes: Match3 | Google Play: Match3
B
98
S
33
G
30
Posts: 1,124
Reputation: 27,805

Post » Sat Nov 30, 2013 8:16 am

You could also try adding Lerp(Self.X , "destination X" , 0.2)

0.2 is the speed and self.X is the starting point to "destination X"

This will making the slide in and out look smoother and elegant ;)
B
40
S
9
G
5
Posts: 177
Reputation: 6,805


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 8 guests