Package games.pixscape.runtime.api
Interface SpritesAPI
public interface SpritesAPI
Factory API for runtime sprite entities.
Spawned sprites use assets from the current scene atlas. The asset must be included in
Runtime Availability before export, otherwise spawning fails with an
IllegalArgumentException.
-
Method Summary
-
Method Details
-
spawn
Creates a sprite entity from an asset id at world position(x, y).- Parameters:
assetId- exported asset id to use for the sprite regionx- initial world x positiony- initial world y position- Returns:
- fluent reference to the created sprite entity
- Throws:
IllegalArgumentException- when the asset is not available in the current scene atlas
-
spawn
Creates a sprite entity from an asset name at world position(x, y).- Parameters:
name- exported asset name to use for the sprite regionx- initial world x positiony- initial world y position- Returns:
- fluent reference to the created sprite entity
- Throws:
IllegalArgumentException- when the asset is not available in the current scene atlas
-