Get current layer name

  • In an event how do I get the current layer name?

    i.e. I want to compare an instance variable to see if it matches the layer name of the currently active layer. Then I can make a sprite invisible if it isn't bound to a layer.. thus retaining object state. I need to do this because I can go in and out of rooms, pickup stuff one time only.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sorry I mean LAYOUT name not layer name.

    So if I have

    Layout1<>MainEventSheet

    Layout2<>MainEventSheet

    A global sprite with an instance variable "BoundLayout" = "Layout1"

    On my main event sheet I want to "at start of layout" set any sprites that aren't on this layout to visible = false.

    So then if I use global sprite objects can show/hide depending on current layout.

  • Can you do something like?

    On start of layout

    (subevent)If LayoutName = Sprite.LayoutName then (actions)

    where Sprite.LayoutName is an instanced text variable.

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