Skip to content

PatternShapes

Extends: Node2D

Description

The parent class holding all PatternShape of a Level.

Properties

Level Level
PatternShapeTool Tool

Methods

Dictionary[] Save ( )
void Load ( Dictionary[] data )
PatternShape LoadShape ( Dictionary data )
void Resize ( int x, int y, int w, int h )
void AddLayer ( int layer )
Node2D GetOrMakeLayer ( int layer )
PatternShape[] GetShapes ( )
void DrawRect ( Rect2 rect, bool invertAction )
void DrawCircle ( Rect2 rect, int sides, bool invertAction )
void DrawPolygon ( Vector2[] points, bool invertAction )
void AddPolygon ( Vector2[] points, Rect2 bounds, bool invertAction )

Property Descriptions

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

Method Descriptions

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


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

  • void AddLayer ( int layer ):
    Make a new layer node that holds pattern shapes in that layer.

  • Node2D GetOrMakeLayer ( int layer ):
    Gets the parent node of a layer or makes one if it does not exist. Calls AddLayer().


  • void DrawRect ( Rect2 rect, bool invertAction ):
    Create a new PatternShape using a rectangle.



  • void AddPolygon ( Vector2[] points, Rect2 bounds, bool invertAction ):
    The internal method DrawRect(), DrawCircle(), and DrawPolygon() all call to create new shapes. Not advisable to call directly.