How do I keep values for some objets in different Layouts?

Get help using Construct 2

Post » Thu Nov 05, 2015 4:47 pm

Hi.

I have different layouts in my project, and in one of them I have a checkbox.
I want that when the user select the checkbox (in a previous menu of the game), the colour of the player image change, but I dont know why I can't do it...

In the checkbox layer's I set an action: When checkbox is checked-> "Set effect black/white enabled".
But I check the checkbox, game starts and the colour isn't aplied. What can I do?

Thank you so much.
B
3
Posts: 5
Reputation: 185

Post » Thu Nov 05, 2015 5:07 pm

@mikkos9
mikkos9 wrote:Hi.

I have different layouts in my project, and in one of them I have a checkbox.
I want that when the user select the checkbox (in a previous menu of the game), the colour of the player image change, but I dont know why I can't do it...

In the checkbox layer's I set an action: When checkbox is checked-> "Set effect black/white enabled".
But I check the checkbox, game starts and the colour isn't aplied. What can I do?

Thank you so much.


Make sure to set the tickbox property 'Global' to 'Yes'.

This will alow the value to be accessible throughout the whole project, rather than just the Layout it is on.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
136
S
31
G
86
Posts: 5,481
Reputation: 59,748

Post » Thu Nov 05, 2015 9:20 pm

zenox98 wrote:@mikkos9
mikkos9 wrote:Hi.

I have different layouts in my project, and in one of them I have a checkbox.
I want that when the user select the checkbox (in a previous menu of the game), the colour of the player image change, but I dont know why I can't do it...

In the checkbox layer's I set an action: When checkbox is checked-> "Set effect black/white enabled".
But I check the checkbox, game starts and the colour isn't aplied. What can I do?

Thank you so much.


Make sure to set the tickbox property 'Global' to 'Yes'.

This will alow the value to be accessible throughout the whole project, rather than just the Layout it is on.


Thanks for your reply.

If I set the tickbox property Global to Yes, the tickbox is always visible. Even when Im playing... And the colour is not aplied.
B
3
Posts: 5
Reputation: 185

Post » Thu Nov 05, 2015 9:24 pm

Does the event sheet attached to the layout have an action to set the effect enabled?

I would set a global variable on checkbox checked and check for that variable in the layouts I want to affect..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Nov 05, 2015 9:44 pm

mikkos9 wrote:Thanks for your reply.

If I set the tickbox property Global to Yes, the tickbox is always visible. Even when Im playing... And the colour is not aplied.


In the next Layout you can set the tickbox property to invisible. The tickbox value is still accessible (easily tested).

You say it doesn't work but without seeing your work, it's impossible to say why.

It would probably be easiest to just do what LittleStain suggests.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
136
S
31
G
86
Posts: 5,481
Reputation: 59,748

Post » Fri Nov 06, 2015 1:15 pm

The question is that I can set to global a "Text" object with colour font to "Black".
And in another Layout set: System->On start of layout-> Set "Text" colour to White.

And the object remains still black...

I don't understand why changes doesnt save between two different layouts...

DONE: I finally set global to yes, and to invisible in the layout that I dont want that object remains visible.
AND I have to modify the values of the object IN the last layout wich is modifying the object.
Before I was modifying the object in a layout, and then when the next layout execute the objet, the layout modify the atributes of my object and it didn't remains with the values of my previous layout.

Sorry for my bad english, and thanks all for your help :)
B
3
Posts: 5
Reputation: 185


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests