Skip to content

Walls

Extends: Node2D

Description

The parent class holding all Wall of a Level.

Properties

Level Level
Dictionary CloningRemap

Methods

Dictionary[] Save ( )
void Load ( Dictionary[] data )
void Resize ( int x, int y, int w, int h )
Wall AddWall ( Vector2[] points, Texture texture, Color color, bool loop = true, bool shadow = true, int type = 0, int joint = 1, bool normalizeUV = true )
bool TryMerge ( Vector2[] points, Texture texture )
void MoveToBack ( Wall wall )
void LoadWall ( Dictionary data )

Property Descriptions

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

  • Dictionary CloningRemap:
    A lookup table of int key - int value pairs for mapping the old wall id to new unique ones when a Level is cloned.

Method Descriptions

  • Dictionary[] Save ( ):
    Save all walls 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 wall data. Used by a saved map file to load existing walls.

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

  • Wall AddWall ( Vector2[] points, Texture texture, Color color, bool loop = true, bool shadow = true, int type = 0, int joint = 1, bool normalizeUV = true ):
    Create a new Wall and add to self as a child. The parameter type determines the wall type. Valid options are: 0 = Auto, 1 = Manual, 2 = Cave. The parameter joint determines the joint type. Valid options are: 0 = Sharp, 1 = Bevel, 2 = Round. The parameter normalize UV will make the software recalculate a wall's UV so that it is more uniform.

  • bool TryMerge ( Vector2[] points, Texture texture ):
    Try to merge a set of points as part of an existing wall instead of creating a new Wall. Returns true if it succeeds in doing so.

  • void MoveToBack ( Wall wall ):
    Move a Wall to the front of the children list in the SceneTree so that it is rendered last. (Back as in background).

  • void LoadWall ( Dictionary data ):
    Load a single Wall into this level. Called by Load() as it loads all the walls.