Skip to content

Wall

Extends: Node2D

Description

A Wall is a Dungeondraft asset instance of what the user sees as a wall from the WallTool. See Asset Instance.

Properties

Rect2 GlobalRect
Vector2[] Points
Texture Texture
Texture EndTexture
Color Color
int Type
int Joint
bool NormalizeUV
bool Loop
bool HasShadow
Line2D[] lines
LightOccluder2D[] occluders
Node2D shadows
Level Level
Portal[] Portals

Methods

Dictionary Save ( bool copy = false )
void Load ( Dictionary data )
void RemakeLinesWhenAllPortalsReady ( )
void Clear ( )
void Set ( Vector2[] points, Texture texture, Color color, bool loop = true, bool shadow = true, int type = 0, int joint = 1, bool normalizeUV = true )
void Offset ( Vector2 offset )
void UpdateTexture ( Texture texture )
void SetColor ( Color color )
Portal AddPortal ( Texture texture, bool closed, Vector2 position, Vector2 direction, int pointIndex, float radius, bool flip )
void InsertPortal ( Portal portal, bool remakeLines )
void RemovePortal ( Portal portal )
void InsertPoint ( int index, Vector2 point )
void DeletePoint ( int index )
void ModifyPoint ( int index, Vector2 point )
void RemakeLines ( )
bool IsMouseWithin ( )

Property Descriptions

  • Rect2 GlobalRect:
    The global Rect2 enclosing the Roof. DO NOT MODIFY.


  • Texture Texture:
    Gets the wall end texture. Do not modify. Use UpdateTexture() to modify.

  • Texture EndTexture:
    Gets the wall end texture. Do not modify.

  • Color Color:
    Gets the wall joint type. Use Set() to modify. Use SetColor() to modify.

  • int Type:
    Gets the wall type. Use Set() to modify. 0 = Auto, 1 = Manual, 2 = Cave. Determines usage.

  • int Joint:
    Gets the wall joint type. Use Set() to modify. 0 = Sharp, 1 = Bevel, and 2 = Round.

  • bool NormalizeUV:
    Gets or sets if this wall uses normalized UV for the texture. Use Set() to modify.

  • bool Loop:
    Gets or sets if this wall loops. Use Set() to modify.

  • bool HasShadow:
    Gets or sets if this wall has shadows.

  • Line2D[] lines:
    Array of Line2D that visually displays the Wall.

  • LightOccluder2D[] occluders:
    Reference to the light blockers associated with this wall. Cannot add directly.

  • Node2D shadows:
    Reference to the shadows associated with this Wall.

  • Level Level:
    Reference to the Level in which this Wall is placed.

  • Portal[] Portals:
    Return an Array of all the Portals. Cannot add directly.

Method Descriptions

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

  • void Load ( Dictionary data ):
    Load a saved Wall data. Used by a saved map file to load existing walls.


  • void Clear ( ):
    Deletes all information inside the wall. Only use preceding a full deletion of the Wall

  • void Set ( Vector2[] points, Texture texture, Color color, bool loop = true, bool shadow = true, int type = 0, int joint = 1, bool normalizeUV = true ):
    Initialize and set options for the wall. Type is the type of wall. Valid options are: 0 = Auto, 1 = Manual, 2 = Cave. Auto is from Floor Shape Tool, Manual is from Wall Tool, and 2 is from Cave Tool. Joint parameter valid options are: 0 = Sharp, 1 = Bevel, and 2 = Round.

  • void Offset ( Vector2 offset ):
    Move all the points and portals of this wall by the offset. Recreates visuals.



  • Portal AddPortal ( Texture texture, bool closed, Vector2 position, Vector2 direction, int pointIndex, float radius, bool flip ):
    Creates a new Portal along the wall. Position is in local space to the Wall. PointIndex is the index of the wall's point just before the Portal placement.

  • void InsertPortal ( Portal portal, bool remakeLines ):
    Insert a Portal onto this Wall manually. Proceed with caution.


  • void InsertPoint ( int index, Vector2 point ):
    Add a point onto the wall. Index is the point preceding the segment where you want to add a point.



  • void RemakeLines ( ):
    Call to refresh visuals after a change if not done automatically by Dungeondraft.

  • bool IsMouseWithin ( ):
    Checks if the mouse cursor is over the wall. Only used by the SelectTool.