How do I create good custom buttons.

Get help using Construct 2

Post » Wed May 06, 2015 7:05 pm

Hello everyone, I'm trying to develop this custom buttons so they can have more effects on in and make the game more attractive you know? Those type of buttons that change shape, or color, or size whenever the mouse is over it or clicking it.

For now I'm using a code like, "If mouse is over Button" Change Button frame to frame(1).
else frame(0).

This works like a charm... sometimes. Whenever I put the mouse over the button it change it's frame, but sometimes (usually at the start of the layout) when I put the mouse over the button ALL the buttons change frame at the same time. Other times the button doesn't change back to frame(0) when the cursor is not over.

When we all know that for a good game we need a interface that works the same way 100% of the time, this unstable thing that sometimes work and sometimes doesn't destroy the game completely.

Have anyone ever tried anything like this, or gone throw the same kind of problem? Any tips or suggestions about it?

Thank you for your time :)
B
17
S
7
Posts: 277
Reputation: 2,514

Post » Thu May 07, 2015 12:05 am

I think the problem in the event's.
Can you upload your capx?
Image
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155

Post » Thu May 07, 2015 6:24 am

I'm affraid I don't know how to upload a capx D:

I put it on dropbox, don't know if this works though

https://dl.dropboxusercontent.com/u/18345677/ButtonTest.caproj
B
17
S
7
Posts: 277
Reputation: 2,514

Post » Thu May 07, 2015 7:21 am

@RayKi in C2 Click the file button(top left) there is a option to save a single file that creates a .capx
B
42
S
17
G
2
Posts: 850
Reputation: 6,209

Post » Fri May 08, 2015 11:49 am

Ah! Ok then, here is the Capx.
https://dl.dropboxusercontent.com/u/183 ... ample.capx

Lol, thanks
B
17
S
7
Posts: 277
Reputation: 2,514

Post » Fri May 08, 2015 6:17 pm

No matter how I modify the code, the same problem continues
B
17
S
7
Posts: 277
Reputation: 2,514

Post » Fri May 08, 2015 7:38 pm

Dont use family "Buttons" for mouse events.....
..mouse is too fast for C2 :D

.........Cursor is over "Play" set frame 1 else 0...etc
Image
B
64
S
23
G
7
Posts: 1,482
Reputation: 10,825

Post » Fri May 08, 2015 8:39 pm

Oh... That will be quite a pain... But ok, guess that's how it's going to be. Thank you friend ^^
B
17
S
7
Posts: 277
Reputation: 2,514

Post » Fri May 08, 2015 8:40 pm

I use two separate sprites.

One is called "Button" and one is called "ButtonHover", then I just lay them on top of each other and set opacity from 100 to 0 and visa versa.
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Post » Fri May 08, 2015 9:45 pm

You can put "For each Buttons" at the top of the second event.

*edit* and set the buttons animation speed to 0.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,630


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Casimir, pwrtoppl, resdesign and 9 guests