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

  • 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.

  • mikkos9

    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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • mikkos9

    > 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.

  • 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..

  • 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.

  • 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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)