savoiardi/sprite
Sprite creation and sprite-specific transforms.
Three.js sprites are Object3D billboards with a center anchor and a
sprite-specific material contract, so this module mirrors that split with a
dedicated Sprite type plus safe conversions back to Object3D.
Types
Values
pub fn create(material: material.Material) -> Sprite
Creates a sprite from a sprite material.
pub fn create_default() -> Sprite
Creates a sprite with Three.js’s default sprite material.
pub fn from_object3d(
object: object.Object3D,
) -> Result(Sprite, Nil)
Safely downcasts an object to a sprite.
pub fn is_sprite(object: object.Object3D) -> Bool
Returns whether an object is a sprite.