Skip to content

Text

Extends: LineEdit

Description

A Text is a Dungeondraft asset instance of what the user sees as an text from the TextTool. See Asset Instance.

Properties

int boxShape
String fontName
int fontSize
Color fontColor
int borderWidth
Dictionary dataOnFocus
bool QueueNewHistoryRecord

Methods

Dictionary Save ( bool copy = false )
void Load ( Dictionary data )
void Replace ( Dictionary data )
bool IsMouseWithin ( )
void SetFont ( String name, int size )
void SetFontSize ( int size )
void SetFontColor ( Color color )
void EnableTextBox ( int borderWidth, Color bgColor, Color borderColor, int shape )
void DisableTextBox ( )
void SetBoxShape ( int shape )
void SetBorderWidth ( int width )
void HandleExport ( bool exporting )

Property Descriptions

  • int boxShape:
    Not set manually. 0 = None, 1 = Square, 2 = Rounded.

  • String fontName:
    Not set manually.

  • int fontSize:
    Not set manually.

  • Color fontColor:
    Not set manually.

  • int borderWidth:
    Not set manually.

  • Dictionary dataOnFocus:
    The saved data when this Text is in focus in case an Undo record needs to be recorded.

  • bool QueueNewHistoryRecord:
    Tells Dungeondraft to record the Undo History of any changes when the focused text leaves focus.

Method Descriptions

  • Dictionary Save ( bool copy = false ):
    Save the Text 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 Text data. Used by a saved map file to load existing texts.

  • void Replace ( Dictionary data ):
    Replace an existing text with saved data. Used by Undo History.

  • bool IsMouseWithin ( ):
    Checks if the mouse cursor is over the Text. Only used by the SelectTool.






  • void SetBoxShape ( int shape ):
    Changes the shape of the text box. 0 = None, 1 = Square, 2 = Rounded.


  • void HandleExport ( bool exporting ):
    Called during the export process so the font sizing would be accurate. Not needed to be manually called.