VisibilityState

From Game Editor

Revision as of 00:30, 11 May 2011 by Skydereign (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

int VisibilityState(char *actorName, int state);

This changes the actorName's visibility state. The three states are, ENABLE, DISABLE, DONT_DRAW_ONLY. Unlike setting transp to 1, setting an actor's visiblity state to DONT_DRAW_ONLY actually makes the actor invisible, while transp leaves a very light version of the actor. Returns 1 if successful, 0 if error.

VisibilityStateInput

actorName

  • "Event Actor": Actor that is receiving the current event.
  • "Parent Actor": Event Actor's parent, if actor has a parent.
  • "Creator Actor": Event Actor's creator, if Event Actor has been created in some "Create Actor" action.
  • "Collide Actor": Actor that collided with the event Actor.
  • Any Actor name or clonename in the game.


state

  • ENABLE: Sets the actor to be visible.
  • DISABLE: Makes the actor invisible, and disables its events.
  • DONT_DRAW_ONLY: Makes the actor invisible, but still receives events and actions.


Example:

Create a ui that only appears in game. Parent the ui elements to the view actor. This will keep the elements following the view, as well as sharing certain states, namely its visibility state. In the view's create actor, disable its visibility state to make the ui invisible.

view -> Create Actor -> Script Editor

VisiblityState("Event Actor", DISABLE);
    • NOTE: This method will not work if your view has events that need to trigger in the menu. To prevent any problems you can create a separate actor that is parented to the view.

Now, when you enter the actual game, simply re-enable the visibility state.


gameButton -> Mouse Button Down (Left) -> Script Editor

VisibilityState("view", ENABLE);