@emile/engine / rendering/sprite-creators/physicsEntitySpriteCreator / PhysicsEntitySpriteCreator
Class: PhysicsEntitySpriteCreator
Defined in: src/rendering/sprite-creators/physicsEntitySpriteCreator.ts:14
A sprite creator.
Sprite creators are used to create, update and delete sprites in the renderer.
If the sprite creator update method returns a ContainerChild
, delete will be called and the returned ContainerChild
will replace the old one.
Warning
Your create and delete methods are responsible for adding/removing the sprite from the world container. The renderer will not do this for you.
Implements
Constructors
new PhysicsEntitySpriteCreator()
new PhysicsEntitySpriteCreator(
defaultColor
,defaultOpacity
,zIndex
,rigidbodyRadius
,rigidbodyOpacity
):PhysicsEntitySpriteCreator
Defined in: src/rendering/sprite-creators/physicsEntitySpriteCreator.ts:24
Parameters
defaultColor
ColorSource
defaultOpacity
number
zIndex
undefined
| number
rigidbodyRadius
number
= 0.1
rigidbodyOpacity
number
= 0.5
Returns
PhysicsEntitySpriteCreator
Properties
create
readonly
create:SpriteCreatorCreate
Defined in: src/rendering/sprite-creators/physicsEntitySpriteCreator.ts:38
Creates a sprite in the renderer.
Param
The registry of the renderer
Param
The pixi app of the renderer
Param
The entity to create the sprite for
Returns
The created sprite
Implementation of
delete
readonly
delete:SpriteCreatorDelete
Defined in: src/rendering/sprite-creators/physicsEntitySpriteCreator.ts:117
Deletes a sprite from the renderer.
Param
The registry of the renderer
Param
The pixi app of the renderer
Param
The entity to delete the sprite for
Param
The sprite to delete
Implementation of
query
readonly
query:EntityQuery
Defined in: src/rendering/sprite-creators/physicsEntitySpriteCreator.ts:15
The query to match entities against.
The create, update and delete methods will only be called for entities that match this query.
If not set, the create, update and delete methods will be called for all entities.
Implementation of
update
readonly
update:SpriteCreatorUpdate
Defined in: src/rendering/sprite-creators/physicsEntitySpriteCreator.ts:94
Updates a sprite in the renderer.
Param
The registry of the renderer
Param
The pixi app of the renderer
Param
The entity to update the sprite for
Param
The sprite to update
Param
The delta time since the last engine update
Returns
The new created sprite