SpriteMap

Class used to manage a grid restricted sprite deployment on an Output plane.

Hierarchy

  • SpriteMap

Implements

Index

Constructors

constructor

Find examples in Playground
  • Creates a new SpriteMap

    Parameters

    • name: string

      defines the SpriteMaps Name

    • atlasJSON: ISpriteJSONAtlas

      is the JSON file that controls the Sprites Frames and Meta

    • spriteSheet: Texture

      is the Texture that the Sprites are on.

    • options: ISpriteMapOptions

      a basic deployment configuration

    • scene: Scene

      The Scene that the map is deployed on

    Returns SpriteMap

Properties

atlasJSON

Find examples in Playground
atlasJSON: ISpriteJSONAtlas

The JSON file with the frame and meta data

name

Find examples in Playground
name: string

The Name of the spriteMap

options

Find examples in Playground

Arguments passed with the Constructor

spriteSheet

Find examples in Playground
spriteSheet: Texture

The systems Sprite Sheet Texture

sprites

Find examples in Playground
sprites: Array<ISpriteJSONSprite>

Public Sprite Storage array, parsed from atlasJSON

Accessors

animationMap

Find examples in Playground
  • Sets the AnimationMap

    Returns RawTexture

  • Sets the AnimationMap

    Parameters

    Returns any

position

Find examples in Playground
  • Returns the Position of Output Plane

    Returns Vector3

  • Returns the Position of Output Plane

    Parameters

    Returns any

rotation

Find examples in Playground
  • Returns the Rotation of Output Plane

    Returns Vector3

  • Returns the Rotation of Output Plane

    Parameters

    Returns any

spriteCount

Find examples in Playground
  • get spriteCount(): number
  • Returns the Number of Sprites in the System

    Returns number

Methods

addAnimationToTile

Find examples in Playground
  • addAnimationToTile(cellID?: number, _frame?: number, toCell?: number, time?: number, speed?: number): void
  • Modifies the data of the animationMap

    Parameters

    • Optional cellID: number

      is the Index of the Sprite

    • Optional _frame: number

      is the target Animation frame

    • Optional toCell: number

      is the Target Index of the next frame of the animation

    • Optional time: number

      is a value between 0-1 that is the trigger for when the frame should change tiles

    • Optional speed: number

      is a global scalar of the time variable on the map.

    Returns void

changeTiles

Find examples in Playground
  • changeTiles(_layer: number | undefined, pos: Vector2 | Vector2[], tile?: number): void
  • Modifies the data of the tileMaps

    Parameters

    • _layer: number | undefined

      is the ID of the layer you want to edit on the SpriteMap

    • pos: Vector2 | Vector2[]

      is the iVector2 Coordinates of the Tile

    • Optional tile: number

      The SpriteIndex of the new Tile

    Returns void

dispose

Find examples in Playground
  • dispose(): void

getMousePosition

Find examples in Playground
  • Gets the UV location of the mouse over the SpriteMap.

    Returns Vector2

    Vector2 the UV position of the mouse interaction

getTileID

Find examples in Playground
  • Returns tileID location

    Returns Vector2

    Vector2 the cell position ID

loadTileMaps

Find examples in Playground
  • loadTileMaps(url: string): void
  • Imports the .tilemaps file

    Parameters

    • url: string

      of the .tilemaps file

    Returns void

saveTileMaps

Find examples in Playground
  • saveTileMaps(): void
  • Exports the .tilemaps file

    Returns void

Generated using TypeDoc