How do I change the functions on the same button?

Get help using Construct 2

Post » Sun Aug 28, 2016 12:53 pm

Edit #2. Solved thanks to plinkie, I leave this post as it is if any other users in future google and find this. :D

So I have a button that will scale the game if the user wants a smaller / bigger layout size,

Image

I want to use the same button to change the scale again, so if the player presses on the button first time,

The game will scale like this above,

then if they press the button again, the game will scale back to 1.0

So first time they press, the game will scale in making it smaller, then this gets disabled and the other one gets activated so if the player presses again, the game will scale back. over and over

How do I do this?

Extra note, I cannot use 2 different buttons (That change collision, it needs to be the same button)


so an example how I want it to look (This dosent work)

Image

Edit #1.

This code actually works, but only 1 time

Image

I guess it's because the signal has been called which makes it's perm active, is there a way to reset it so it waits to get called again?

Signal
Resume any events paused with a Wait for signal action with the given tag.
Last edited by Triforce on Sun Aug 28, 2016 1:18 pm, edited 2 times in total.
B
21
S
9
G
8
Posts: 188
Reputation: 6,069

Post » Sun Aug 28, 2016 1:10 pm

I use variables for this, on the button itself or global. You can toggle a boolean true or false if they are the only two button options.
On button clicked, if variable = true, Set layout scale to 1.5. Else set layout scale to 1. And on button clicked, toggle boolean.
B
45
S
15
G
73
Posts: 2,002
Reputation: 43,386

Post » Sun Aug 28, 2016 1:17 pm

plinkie wrote:I use variables for this, on the button itself or global. You can toggle a boolean true or false if they are the only two button options.
On button clicked, if variable = true, Set layout scale to 1.5. Else set layout scale to 1. And on button clicked, toggle boolean.


Why didn't I think of this before! Thanks

Image

It works, thanks! :lol:
B
21
S
9
G
8
Posts: 188
Reputation: 6,069


Return to How do I....?

Who is online

Users browsing this forum: luck1210, RedBlackSpade and 7 guests