how to change the buttons style?

Get help using Construct 2

Post » Mon Jun 18, 2012 2:41 pm

hi, i read a lot of post but i can't find how to change the buttons style. color, style, font etc etc.
thank you all
B
10
S
2
G
3
Posts: 49
Reputation: 2,333

Post » Mon Jun 18, 2012 4:23 pm

Their appearance is precisely why I don't use the button object much. I just use a sprite (or sometimes a sprite + text object). You can create different animations for the up/down/over states if you need them, and have buttons that maintain the style of your game.



B
29
S
11
G
12
Posts: 281
Reputation: 11,888

Post » Mon Jun 18, 2012 5:04 pm

so you use sprite and you put images in the sprite?
thank you
B
10
S
2
G
3
Posts: 49
Reputation: 2,333

Post » Mon Jun 18, 2012 5:51 pm

hmm ok the idea i do it is : i put sprite with all buttons i want like pause,resume , levels,... these stuffs doesn't need text they need shapes for that so in 1 sprite i have about 8-10 frames so put them with animation speed 0 and i put them on screen and choose the frame i want ,
so in event if mouse click and frame = 1 -->> pause game or whatever... and so on with all frames if you want create many buttons in screen like you want to create 3 buttons with i click pause you have to make 3 different sprites or there is another way but i think its harder to understand on the future ^^


good luck on buttons :P
B
48
S
15
G
6
Posts: 795
Reputation: 12,035

Post » Mon Jun 18, 2012 6:24 pm

You can customise the Button object using the "Set CSS style" action. These use the same rules as CSS. The default (set "color" to "red") makes the button text red, for example.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,630

Post » Tue Jun 19, 2012 7:44 am

@ashley thank you. where i can find css property? is there a manual in the main site? or are general property?
B
10
S
2
G
3
Posts: 49
Reputation: 2,333

Post » Tue Jun 19, 2012 7:51 am

It's an action on the button object. Go to your event sheet and add a new action:

[code]Every Tick:
-> Set CSS Style[/code]
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Tue Jun 19, 2012 7:53 am

ok but, what are the css property i can change?
B
10
S
2
G
3
Posts: 49
Reputation: 2,333

Post » Tue Jun 19, 2012 8:14 am

Text properties are listed on W3Schools:

http://www.w3schools.com/css/css_text.asp
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Tue Jun 19, 2012 8:26 am

@Nimtrix thank you
B
10
S
2
G
3
Posts: 49
Reputation: 2,333

Next

Return to How do I....?

Who is online

Users browsing this forum: selaus and 0 guests