Interface PlatformArt
- All Known Implementing Classes:
ProceduralArt
Supplies the images a PlatformView draws. The simulation never sees any of
it, so art can change -- a skin, a seasonal theme, a 2.5D model set --
without changing how a level plays or what a replay hashes to.
ProceduralArt implements every method with generated shapes, so a level is
playable before any art exists; extend it and override what you have art for.
-
Method Summary
Modifier and TypeMethodDescriptionThe animator for an actor.entity(LevelEntity entity, int tick) The image for an entity this tick.goal(int width, int height, int tick) The image for the level's goal this tick, drawn centered on the goal rectangle (PlatformWorld#getGoal()).platform(MovingPlatform platform) The image for a moving platform.The sprite sheet for an actor; frames are chosen by#animator(Actor).The image for one cell.
-
Method Details
-
tile
The image for one cell. Called when the view first draws a cell and again whenever the cell changes (a door opening, a block crumbling).
Parameters
grid: the grid, to look at neighbors for auto-tilingcol: the columnrow: the row
Returns
an image the size of a tile in pixels, or null to draw nothing
-
sheet
The sprite sheet for an actor; frames are chosen by
#animator(Actor). The frame is drawn centered on the body horizontally and standing on its bottom edge, so a sheet may be larger than the body.Parameters
actor: the actor;Actor#getKind()names its art
Returns
the sheet
-
animator
The animator for an actor.
Parameters
actor: the actor
Returns
the animator, typically shared by every actor of a kind
-
entity
The image for an entity this tick. Called every tick, so return cached images.
Parameters
entity: the entity;LevelEntity#getType()andLevelEntity#getPhase()select the imagetick: the world tick, for animating
Returns
the image, drawn centered on the entity, or null to draw nothing
-
platform
The image for a moving platform.
Parameters
platform: the platform
Returns
an image the platform's size in pixels
-
goal
The image for the level's goal this tick, drawn centered on the goal rectangle (
PlatformWorld#getGoal()).Parameters
width: the goal's width in pixelsheight: the goal's height in pixelstick: the world tick, for animating
Returns
the image, or null to draw nothing
-