VisibilityEnabler2D

Inherits: VisibilityNotifier2D < Node2D < CanvasItem < Node < Object

Enables certain nodes only when visible.

Description

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

Methods

boolis_enabler_enabled ( Enabler enabler ) const
voidset_enabler ( Enabler enabler, bool enabled )

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 — This enabler will stop AnimatedSprite nodes animations.
  • ENABLER_MAX = 6 — Represents the size of the Enabler enum.

Property Descriptions

Defaulttrue
Setterset_enabler(value)
Getteris_enabler_enabled()

If true, RigidBody2D nodes will be paused.


  • bool pause_animated_sprites
Defaulttrue
Setterset_enabler(value)
Getteris_enabler_enabled()

If true, AnimatedSprite nodes will be paused.


  • bool pause_animations
Defaulttrue
Setterset_enabler(value)
Getteris_enabler_enabled()

If true, AnimationPlayer nodes will be paused.


  • bool pause_particles
Defaulttrue
Setterset_enabler(value)
Getteris_enabler_enabled()

If true, Particles2D nodes will be paused.


  • bool physics_process_parent
Defaultfalse
Setterset_enabler(value)
Getteris_enabler_enabled()

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


Defaultfalse
Setterset_enabler(value)
Getteris_enabler_enabled()

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

Method Descriptions

Returns whether the enabler identified by given Enabler constant is active.


Sets active state of the enabler identified by given Enabler constant.

Doc ID missing

Disclaimer: This page has been automaticaly and directly extracted from the official Godot Docs website, the 1970-01-01 at 00:00:00. It’s the English Stable version because it’s what most Godot users should use. The Copyright owners are Juan Linietsky, Ariel Manzur and the Godot community. CC-BY 3.0. Thanks for your patience and generosity.