Interface ISpriteManager
cellHeight: number;
cellWidth: number;
doNotSerialize?: boolean;
isPickable: boolean;
layerMask: number;
name: string;
renderingGroupId: number;
scene: Scene;
sprites: Sprite[];
texture: Texture;
uniqueId: number;
dispose(): void;
intersects(
ray: Ray,
camera: Camera,
predicate?: (sprite: Sprite) => boolean,
fastCheck?: boolean,
): Nullable<PickingInfo>;
isReady?(): boolean;
multiIntersects(
ray: Ray,
camera: Camera,
predicate?: (sprite: Sprite) => boolean,
): Nullable<PickingInfo[]>;
rebuild(): void;
render(): void;
serialize(serializeTexture?: boolean): any;
}
Hierarchy (View Summary)
- IDisposable
- ISpriteManager
Implemented by
Index
Properties
cell Height
Defines the default height of a cell in the spritesheet
cell Width
Defines the default width of a cell in the spritesheet
Optionaldo Not Serialize
Specifies if the sprite manager should be serialized
is Pickable
Gets or sets a boolean indicating if the mesh can be picked (by scene.pick for instance or through actions). Default is true
layer Mask
Restricts the camera to viewing objects with the same layerMask. A camera with a layerMask of 1 will render spriteManager.layerMask & camera.layerMask!== 0
name
Gets manager's name
rendering Group Id
Specifies the rendering group id for this mesh (0 by default)
scene
Gets the hosting scene
sprites
Defines the list of sprites managed by the manager.
texture
Gets or sets the spritesheet texture
unique Id
Gets or sets the unique id of the sprite manager
Methods
dispose
-
Releases all held resources
Returns void
intersects
-
intersects(
ray: Ray,
camera: Camera,
predicate?: (sprite: Sprite) => boolean,
fastCheck?: boolean,
): Nullable<PickingInfo>Tests the intersection of a sprite with a specific ray.
Parameters
- ray: Ray
The ray we are sending to test the collision
- camera: Camera
The camera space we are sending rays in
Optionalpredicate: (sprite: Sprite) => booleanA predicate allowing excluding sprites from the list of object to test
OptionalfastCheck: booleandefines if the first intersection will be used (and not the closest)
Returns Nullable<PickingInfo>
picking info or null.
- ray: Ray
Optionalis Ready
-
Checks whether this manager can render its sprites in the current render pass. Optional for custom sprite manager implementations.
Returns boolean
true when the manager is ready to render
multi Intersects
-
multiIntersects(
ray: Ray,
camera: Camera,
predicate?: (sprite: Sprite) => boolean,
): Nullable<PickingInfo[]>Intersects the sprites with a ray
Parameters
Returns Nullable<PickingInfo[]>
null if no hit or a PickingInfo array
rebuild
-
Rebuilds the manager (after a context lost, for eg)
Returns void
render
-
Renders the list of sprites on screen.
Returns void
serialize
-
Serializes the sprite manager to a JSON object
Parameters
OptionalserializeTexture: booleandefines whether the texture must be serialized as well (false by default)
Returns any
Defines the minimum interface to fulfill in order to be a sprite manager.