Skip to content

Lights

Extends: Node2D

Description

The parent class holding all Light2D of a Level.

Properties

Level Level
Environment environment

Methods

Light2D CreateLight ( bool showWidget = false )
Dictionary[] Save ( )
void Load ( Dictionary[] data )
Dictionary SaveLight ( Light2D light, bool copy = false )
Light2D LoadLight ( Dictionary data )
void EnableWidgets ( bool value, bool enableAttention = false )
void Resize ( int x, int y, int w, int h )

Property Descriptions

  • Level Level:
    The Level in which this class instance resides.

  • Environment environment:
    Get the reference to the Environment of this Level.

Method Descriptions


  • Dictionary[] Save ( ):
    Save all lights in this level as a list into the save file format and return it as an Array.

  • void Load ( Dictionary[] data ):
    Load a list of saved light data. Used by a saved map file to load existing lights.

  • Dictionary SaveLight ( Light2D light, bool copy = false ):
    Save the Prop into the save file format and return it as a Dictionary. The param copy is only used by copy-pasting feature of Dungeondraft.

  • Light2D LoadLight ( Dictionary data ):
    Load a saved Light data. Used by a saved map file to load existing lights. Called by Load().

  • void EnableWidgets ( bool value, bool enableAttention = false ):
    Toggle if the UI widget for the light is visible.

  • void Resize ( int x, int y, int w, int h ):
    Called automatically when the canvas is resized. DO NOT CALL DIRECTLY. FOR REFERENCE ONLY.