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.
- PatternShapeTool Tool:
Reference to the PatternShapeTool.
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.
- PatternShape LoadShape ( Dictionary data ):
Load a single PatternShape into this level. Called by Load() as it loads all the 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.
- Node2D GetOrMakeLayer ( int layer ):
Gets the parent node of a layer or makes one if it does not exist. Calls AddLayer().
- PatternShape[] GetShapes ( ):
Returns all the PatternShape held by this class.
- void DrawCircle ( Rect2 rect, int sides, bool invertAction ):
Create a new PatternShape using a circle.
- void DrawPolygon ( Vector2[] points, bool invertAction ):
Create a new PatternShape using points of a polygon.
- 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.