Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: TextLevelLoader

[18:7] extends: FxObj

Wraps FXGL's TextLevelLoader (com.almasb.fxgl.entity.level.text.TextLevelLoader), the built-in loader that reads a level from a text grid file. Each cell character maps to an entity via the entity factory (@Spawns annotations on the EntityFactory). Construction takes the per-cell pixel size and the character representing an empty cell.

Methods

  • TextLevelLoader (int BlockWidth = 32, int BlockHeight = 32, string EmptyChar = " ")

    Creates a new TextLevelLoader.

    • @p BlockWidth is the per-cell pixel width.
    • @p BlockHeight is the per-cell pixel height.
    • @p EmptyChar is the character treated as "no entity".
  • adopt (object Ajo)

    Wraps an existing TextLevelLoader AussomJavaObject.

  • load (string UrlString, object WorldObj)

    Loads the level at the given URL with the supplied GameWorld.

    • @p UrlString is a URL string to the text-grid file.
    • @p WorldObj is a GameWorld wrapper.
    • @r A Level wrapper.
  • getBlockWidth ()

    Returns the block width in pixels (single tile width).

  • getBlockHeight ()

    Returns the block height in pixels.

  • getEmptyChar ()

    Returns the empty-character used to skip cells in the grid text (defaults to space).