Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SpriteMap

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

Hierarchy

  • SpriteMap

Implements

Index

Constructors

constructor

  • 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

atlasJSONSearch playground for atlasJSON

atlasJSON: ISpriteJSONAtlas

The JSON file with the frame and meta data

nameSearch playground for name

name: string

The Name of the spriteMap

optionsSearch playground for options

Arguments passed with the Constructor

spriteSheetSearch playground for spriteSheet

spriteSheet: Texture

The systems Sprite Sheet Texture

spritesSearch playground for sprites

sprites: Array<ISpriteJSONSprite>

Public Sprite Storage array, parsed from atlasJSON

Accessors

animationMap

  • Sets the AnimationMap

    Returns RawTexture

  • Sets the AnimationMap

    Parameters

    Returns any

position

  • Returns the Position of Output Plane

    Returns Vector3

  • Returns the Position of Output Plane

    Parameters

    Returns any

rotation

  • Returns the Rotation of Output Plane

    Returns Vector3

  • Returns the Rotation of Output Plane

    Parameters

    Returns any

spriteCount

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

    Returns number

Methods

addAnimationToTileSearch playground for addAnimationToTile

  • 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

changeTilesSearch playground for changeTiles

  • 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

disposeSearch playground for dispose

  • dispose(): void
  • Release associated resources

    Returns void

getMousePositionSearch playground for getMousePosition

  • Gets the UV location of the mouse over the SpriteMap.

    Returns Vector2

    Vector2 the UV position of the mouse interaction

getTileIDSearch playground for getTileID

  • Returns tileID location

    Returns Vector2

    Vector2 the cell position ID

loadTileMapsSearch playground for loadTileMaps

  • loadTileMaps(url: string): void
  • Imports the .tilemaps file

    Parameters

    • url: string

      of the .tilemaps file

    Returns void

saveTileMapsSearch playground for saveTileMaps

  • saveTileMaps(): void
  • Exports the .tilemaps file

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method