Class SpriteMap
Implements
Constructors
constructor
-
new SpriteMap(
name: string,
atlasJSON: ISpriteJSONAtlas,
spriteSheet: Texture,
options: ISpriteMapOptions,
scene: Scene,
): SpriteMapCreates 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
- name: string
Properties
atlas JSON
The JSON file with the frame and meta data
name
The Name of the spriteMap
options
Arguments passed with the Constructor
sprites
Public Sprite Storage array, parsed from atlasJSON
sprite Sheet
The systems Sprite Sheet Texture
Accessors
animation Map
-
Sets the AnimationMap
Returns RawTexture
fog Enabled
-
get fogEnabled(): boolean
Gets or sets a boolean indicating if the sprite map must consider scene fog when rendering
Returns boolean
-
set fogEnabled(value: boolean): void
Parameters
- value: boolean
Returns void
position
-
Returns the Position of Output Plane
Returns Vector3
rotation
-
Returns the Rotation of Output Plane
Returns Vector3
sprite Count
-
get spriteCount(): number
Returns the Number of Sprites in the System
Returns number
use Logarithmic Depth
-
get useLogarithmicDepth(): boolean
Gets or sets a boolean indicating if the sprite map must use logarithmic depth when rendering
Returns boolean
-
set useLogarithmicDepth(value: boolean): void
Parameters
- value: boolean
Returns void
Methods
add Animation To Tile
-
addAnimationToTile(
cellID?: number,
_frame?: number,
toCell?: number,
time?: number,
speed?: number,
): voidModifies the data of the animationMap
Parameters
- cellID: number = 0
is the Index of the Sprite
- _frame: number = 0
is the target Animation frame
- toCell: number = 0
is the Target Index of the next frame of the animation
- time: number = 0
is a value between 0-1 that is the trigger for when the frame should change tiles
- speed: number = 1
is a global scalar of the time variable on the map.
Returns void
- cellID: number = 0
change Tiles
dispose
-
Release associated resources
Returns void
get Mouse Position
-
Gets the UV location of the mouse over the SpriteMap.
Returns Vector2
Vector2 the UV position of the mouse interaction
get Tile ID
get Tile Idx By Name
-
Returns the index of the frame for a given filename
Parameters
- name: string
filename of the frame
Returns number
index of the frame
- name: string
load Tile Maps
-
Imports the .tilemaps file
Parameters
- url: string
of the .tilemaps file
Returns void
- url: string
save Tile Maps
-
Exports the .tilemaps file
Returns void
Class used to manage a grid restricted sprite deployment on an Output plane.