Correct practice with buttons.

Get help using Construct 2

Post » Tue Mar 27, 2012 3:01 pm

Hi all

well, the question is the next:

I have 3 graphics buttons: (btn_next, btn_back, btn_exit)
Every buttons with sprite for 3 states.

I have already created a button how it would work, but I want to do the same for the other 2 buttons.


dude: What is the best way to work?

instance?
reply code for every button? (well... the actions)

thx.

PD.: this is my solution for 3state buttons.
Link_Buttons
B
18
S
5
Posts: 14
Reputation: 1,687

Post » Wed Mar 28, 2012 1:29 pm

If you own a license this should be easier possible with a family containing all three buttons.Joe72012-03-28 13:31:07
B
14
S
6
G
5
Posts: 173
Reputation: 4,742

Post » Wed Mar 28, 2012 2:02 pm

Please upload your capx to dropbox, I can't go past your filehost captchas.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Wed Mar 28, 2012 8:42 pm

So basically you want 3 buttons to have a normal state, a mouseover state and a clicked state?
And this with as less events as possible ?
B
22
S
11
G
9
Posts: 133
Reputation: 6,572

Post » Fri Mar 30, 2012 3:40 pm

No Wyshy, I have ready a 3 states buttons. this works OK.

now...

I thinks, what I need for use this buttons in several diferents buttons?
Joe7 speak of family... I need study it concepts, but if i can't work with "family" in a free licence, bad XD

this night i will create the drobox, Kyatric.

thx




B
18
S
5
Posts: 14
Reputation: 1,687

Post » Fri Mar 30, 2012 7:48 pm

Last edited by Yann on Sun Sep 14, 2014 9:17 pm, edited 1 time in total.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Tue Apr 10, 2012 3:20 pm

Sorry, I was disconnected.

Thank you Yann, this is a 3states button that I created. XD
I have problem to create dropbox.

now, I want to duplicate this button 5 times, but when I click on them then call perform different tasks.

thanks.
B
18
S
5
Posts: 14
Reputation: 1,687

Post » Tue Apr 10, 2012 3:45 pm

Make a general sprite button that has all the functionality you want. Add an instance variable called something like "tag" or "type" and set it to somethin you can use for one kind of button

The exit buttons tag would be "exit" or 0 however you want to do it. Then when the buttons clicked compare the instance variable and check for "exit" if so then do your exit events

Repeat for each type of button
B
13
S
5
G
2
Posts: 306
Reputation: 3,262


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Yahoo [Bot] and 5 guests