Skip to content

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.


  • 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 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.