How do I change button style?

Get help using Construct 2

Post » Wed May 07, 2014 2:11 am

Message: CXY007 can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hello. I found answer here, but not quite
viewtopic.php?f=147&t=70869&p=779168#p779168

I found that if I put the set style in every tick, it use a lot of cpu. otherwise, it goes back to original style when I resize the window. I wonder if there is someway to set it once and for all.

Thanks!
B
5
S
1
Posts: 10
Reputation: 472

Post » Wed May 07, 2014 3:16 am

Why use the button when you can just draw a sprite to look however you want it to and use the touch or click behavior to make it work just like button? The buttons and textboxes, etc... don't always work the same on all platforms anyway (android, ios, etc...) so using sprites gives you much more flexibility and stability.
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,583

Post » Wed May 07, 2014 4:16 am

because I am not a designer and don't know how to draw. :(

Besides, how do I set text on a sprite? If I need all different words, it will kill me to draw so many...
B
5
S
1
Posts: 10
Reputation: 472

Post » Wed May 07, 2014 4:43 am

Found my solution! I need to set the auto font size to false!!!!!!!!!!!!!!
B
5
S
1
Posts: 10
Reputation: 472

Post » Wed May 07, 2014 5:32 am

YOu have a text object that you can set text to. You then pin that to a sprite button. Normal Buttons don't look right in games. It doesn't match the graphics of the game and stands out like a sore thumb. You may want to look at http://www.kenney.nl/assets for their buttons, etc... as they are free as far as I know. Or you can have their whole collection of graphics for use in any game for a small donation. You may also want to look into the sprite font object if you are going to have text in your games. Putting actual text makes the game stutter and drops the framerate so you want to use sprite fonts instead.
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,583

Post » Wed May 07, 2014 3:37 pm

Thank you so much, well definitely try that!
B
5
S
1
Posts: 10
Reputation: 472

Post » Wed May 07, 2014 3:45 pm

Hey, how would I make it so that when you touch the text box or the sprite it works like a button... incredibly lost here
B
6
S
1
Posts: 69
Reputation: 643

Post » Wed May 07, 2014 3:47 pm

There is also the great Sprite Button Behavior Plugin. It adds easy functionality to custom buttons. https://www.scirra.com/forum/viewtopic.php?t=88607&start=0
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Wed May 07, 2014 6:13 pm

You add the touch or mouse objects to your game, then you use them for example:

Touch - On Object (spriteButton) Touched > System GoToLayout "Layout1"
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,583


Return to How do I....?

Who is online

Users browsing this forum: Kin, mickclarke, tinhofiel, TRMG and 57 guests