W3cubDocs

/Godot 3.1

VisibilityEnabler2D

Inherits: VisibilityNotifier2D < Node2D < CanvasItem < Node < Object

Category: Core

Brief Description

Enable certain nodes only when visible.

Properties

bool freeze_bodies
bool pause_animated_sprites
bool pause_animations
bool pause_particles
bool physics_process_parent
bool process_parent

Enumerations

enum Enabler:

  • ENABLER_PAUSE_ANIMATIONS = 0 — This enabler will pause AnimationPlayer nodes.
  • ENABLER_FREEZE_BODIES = 1 — This enabler will freeze RigidBody2D nodes.
  • ENABLER_PAUSE_PARTICLES = 2 — This enabler will stop Particles2D nodes.
  • ENABLER_PARENT_PROCESS = 3 — This enabler will stop the parent’s _process function.
  • ENABLER_PARENT_PHYSICS_PROCESS = 4 — This enabler will stop the parent’s _physics_process function.
  • ENABLER_PAUSE_ANIMATED_SPRITES = 5
  • ENABLER_MAX = 6 — Represents the size of the Enabler enum.

Description

The VisibilityEnabler2D will disable RigidBody2D, AnimationPlayer, and other nodes when they are not visible. It will only affect other nodes within the same scene as the VisibilityEnabler2D itself.

Property Descriptions

bool freeze_bodies

Setter set_enabler(value)
Getter is_enabler_enabled()

If true, RigidBody2D nodes will be paused.

bool pause_animated_sprites

Setter set_enabler(value)
Getter is_enabler_enabled()

If true, AnimatedSprite nodes will be paused.

bool pause_animations

Setter set_enabler(value)
Getter is_enabler_enabled()

If true, AnimationPlayer nodes will be paused.

bool pause_particles

Setter set_enabler(value)
Getter is_enabler_enabled()

If true, Particles2D nodes will be paused.

bool physics_process_parent

Setter set_enabler(value)
Getter is_enabler_enabled()

If true, the parent’s Node._physics_process will be stopped.

bool process_parent

Setter set_enabler(value)
Getter is_enabler_enabled()

If true, the parent’s Node._process will be stopped.

© 2014–2019 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
http://docs.godotengine.org/en/3.1/classes/class_visibilityenabler2d.html