How do I disable a layer and reenable it in game?

0 favourites
  • 11 posts
From the Asset Store
five golem elements Sprites Sheet.Best for enemy or villain game characters.
  • Let's say, I have 3 text objects in a layer. When a button is pressed, these objects get invisible, but they remain touchable, which makes the mouse change if hovered over them. How can I make this layer disabled while it's objects are invisible? Or how do I make the text become untouchable and unclickable while invisible? If it was a sprite would disable colision for them, but text objects do not have this kind of action.

  • Mouse is over object -> set cursor

    And you can add conditions, like is over object, and invert it. (!not over object)

  • No, i guess I introduced my question not correctly. What i need, is to be able somehow, when specific text objects are set invisible by a certain action, so that they become unactive, until another command puts them visible. I am asking for a way to temporarly disable/deactivate a layer or at list a text object or a family of text objects.

    My problem is, that when they are invisible, sometimes you pass with the mouse over them, and you can see the mouse changing as if they where there. And they are clickable, and the player can accidentally click on them, while they are invisible.

  • You can add that in events ...

    This makes it only clickable when visible

    event

    On click object

    obect is visible

    action

    etc

    Force some cursor when mouse over

    event

    on mouse over object

    object is visible (inverted)

    action

    set cursor to default

  • I am very thankful for your answers!

    But, I am not sure i could completely figure out what your first part means:

    "This makes it only clickable when visible

    event

    On click object

    obect is visible

    action

    etc"

    This is the most important thing I need to realize. The part with mouse view I fixed. What exactly stands for " etc" in your above example? I am trying to build this kind of event...

  • anybody?...

  • The etc, was referring to actions you could be doing there ....

    Event

    On click/touch object

    Object is visible (this is an event option for objects, indicating they need to be visible)

    action

    Do something with the clicked, visible, object

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have it setup already, for a long time, and have events to make this object invisible, and visible again. But I cannot find anywhere on the forum a way to simply make such an object inactive, disabled, whatever beter way to call this process. I know how to make them visible and invisible, by even pressing the same button. I am just searching how to make them unclickable...

    For example, for sprites, it is possible to disable collision, as action. For Other object types, is possible to make them enabled/disabled. What action will be good to make a text disabled/ inactive/unclickable as Action?

  • In my event ... I do not set it visible or invisible ...

    The event CHECKS if the object is visible when you clicked it ... if its invisible .. the action will not run. If its visible ... it will perform the action.

  • here is an example of what I have. and even if I make the mouse not change over Objects 1 and 2 while they are invisible, if accidentally clicked, their action will happen. how do I make them not clickable at all while invisible? even if the mouse doesn't show it has changed over them. they are still clickable...

    here's a capx

    . com/file/d/0B09lLdP7JoIAZlh3SmVVZklJT00/view?usp=sharing

    remove the space before .COM

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