Pathway
Extends: Line2D
Description
A Pathway is a Dungeondraft asset instance of what the user sees as an path from the PathTool. See Asset Instance.
Properties
float | Smoothness |
Rect2 | GlobalRect |
Vector2[] | EditPoints |
Vector2[] | GlobalEditPoints |
bool | FadeIn |
bool | FadeOut |
bool | Grow |
bool | Shrink |
bool | BlockLight |
LightOccluder2D | occluder |
OccluderPolygon2D | occluderPolygon |
Methods
Dictionary | Save ( bool copy = false ) |
void | Load ( Dictionary data ) |
void | UpdateGradient ( ) |
void | UpdateOccluder ( ) |
void | SetBlockLight ( bool value ) |
void | SetEditPoints ( Vector2[] points ) |
void | InsertPoint ( int index, Vector2 point ) |
void | DeletePoint ( int index ) |
void | ModifyPoint ( int index, Vector2 point ) |
void | Smooth ( ) |
void | GrowShrinkEnds ( int distance ) |
void | SetWidthScale ( float widthScale ) |
bool | IsMouseWithin ( Vector2 mousePos ) |
Property Descriptions
- float Smoothness:
Gets or sets the path's smoothness. Call Smooth() if subsequent methods you use to do update the Pathway.
- Rect2 GlobalRect:
The global Rect2 that encloses this path. READ ONLY.
- Vector2[] EditPoints:
The edit points of the path in local space. Not normally set here. Call SetEditPoints() instead.
- Vector2[] GlobalEditPoints:
The edit points of the path in world space. READ ONLY.
- bool FadeIn:
Gets or sets the path fade in. Not normally set here. Better to call SetFadeIn() from the PathTool.
- bool FadeOut:
Gets or sets the path fade out. Not normally set here. Better to call SetFadeOut() from the PathTool.
- bool Grow:
Gets or sets the path taper. Not normally set here. Better to call SetTransitionIn()/SetTransitionOut() from the PathTool.
- bool Shrink:
Gets or sets the path taper. Not normally set here. Better to call SetTransitionIn()/SetTransitionOut() from the PathTool.
- bool BlockLight:
Gets the flag that indicates if this object blocks light.
- LightOccluder2D occluder:
The object that blocks light.
- OccluderPolygon2D occluderPolygon:
The special shape that the occluder uses to block light with.
Method Descriptions
- Dictionary Save ( bool copy = false ):
Save the Pathway 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 Pathway data. Used by a saved map file to load existing paths.
- void UpdateGradient ( ):
Update the path visuals to reflect changes in fade in and fade out changes.
- void UpdateOccluder ( ):
Automatically called to update the light blocker to user point position changes.
- void SetBlockLight ( bool value ):
Toggle whether this Pathway blocks lights.
- void SetEditPoints ( Vector2[] points ):
Set or replace the entire set of edit points in world space.
- void InsertPoint ( int index, Vector2 point ):
Insert edit point in world space at index.
- void DeletePoint ( int index ):
Remove edit point at index.
- void ModifyPoint ( int index, Vector2 point ):
Modify the position of an existing point in world space.
- void Smooth ( ):
Take the Edit Points and generate a smooth visual. Called to update the visuals when the path is modified.
- void GrowShrinkEnds ( int distance ):
Called by Smooth() to taper the ends when grow or shrink is set. Not normally called directly.
- void SetWidthScale ( float widthScale ):
Modifies the width of the path.
- bool IsMouseWithin ( Vector2 mousePos ):
Checks if the mouse cursor is over the path. Only used by the SelectTool.