Prop
Extends: Node2D
Description
A Prop is a Dungeondraft asset instance of what the user sees as an object from the ObjectTool. See Asset Instance.
Properties
Sprite | Sprite |
Rect2 | Rect |
bool | HasShadow |
bool | Mirror |
LightOccluder2D[] | occluders |
bool | BlockLight |
bool | isHighlighted |
bool | isSelected |
Color | borderColor |
Rect2 | SelectRect |
Methods
Dictionary | Save ( bool copy = false ) |
void | Load ( Dictionary data ) |
void | SetTexture ( Texture texture ) |
void | SetCustomColor ( Color color ) |
bool | HasCustomColor ( ) |
Color | GetCustomColor ( ) |
void | Highlight ( bool value ) |
void | Select ( bool bvalue ) |
void | SetBlockLight ( bool value ) |
void | GenerateOccluder ( ) |
void | ClearOccluders ( ) |
void | UpdateOccluders ( ) |
Property Descriptions
- Sprite Sprite:
The Sprite displaying the Prop. DO NOT MODIFY.
- Rect2 Rect:
The Rect2 enclosing the Prop. DO NOT MODIFY.
- bool HasShadow:
Set to toggle the shadow.
- bool Mirror:
Set to flip the Prop horizontally.
- LightOccluder2D[] occluders:
Array of the Godot LightOccluder2D that block light for this Prop.
- bool BlockLight:
Gets the flag that indicates if this object blocks light.
- bool isHighlighted:
Determines if the Prop is highlighted. Read only, call Highlight() instead to set.
- bool isSelected:
Determines if the Prop is visually selected. Read only, call Select() instead to set.
- Color borderColor:
This property is set by Dungeondraft to draw a box when this Prop is highlighted or selected. Modify at your own risk.
- Rect2 SelectRect:
This property is set by Dungeondraft to determine the size of the box around the Prop when selected. Automatically updated.
Method Descriptions
- Dictionary Save ( bool copy = false ):
Save the Prop 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 Prop data. Used by a saved map file to load existing objects.
- void SetTexture ( Texture texture ):
Change the Prop to a new Texture.
- void SetCustomColor ( Color color ):
Update to a new custom color and pass the color to the materials.
- bool HasCustomColor ( ):
Return whether or not this Prop is using a custom color
- Color GetCustomColor ( ):
Return the custom color.
- void Select ( bool bvalue ):
Visually select the Prop. Does not mean it is selected in the SelectTool.
- void SetBlockLight ( bool value ):
Toggle whether this Prop blocks lights. Calls GenerateOccluder() or ClearOccluders internally based on value.
- void GenerateOccluder ( ):
Generate Occluders, which Dungeondraft uses to block the light.
- void ClearOccluders ( ):
Remove Occluders, which Dungeondraft uses to block the light.
- void UpdateOccluders ( ):
Refresh Occluders based on the art, which Dungeondraft uses to block the light.