public class Assets
extends java.lang.Object
The Assets class stores references to Filters, Sprites, SpriteSheets, Animations, Sounds, and Music tracks under String names that are unique among each of those types of assets. Assets must be added to the Assets class manually, such as in a CellGame's initActions(), after which they can be accessed at any time.
Constructor and Description |
---|
Assets() |
Modifier and Type | Method and Description |
---|---|
static boolean |
add(java.lang.String name,
Animation animation)
Adds the specified Animation to the list of Animations under the
specified name.
|
static boolean |
add(java.lang.String name,
Filter filter)
Adds the specified Filter to the list of Filters under the specified
name.
|
static boolean |
add(java.lang.String name,
Music music)
Adds the specified Music track to the list of Music tracks under the
specified name.
|
static boolean |
add(java.lang.String name,
Sound sound)
Adds the specified Sound to the list of Sounds under the specified name.
|
static boolean |
add(java.lang.String name,
Sprite sprite)
Adds the specified Sprite to the list of Sprites under the specified
name.
|
static boolean |
add(java.lang.String name,
SpriteSheet spriteSheet)
Adds the specified SpriteSheet to the list of SpriteSheets under the
specified name.
|
static Animation |
getAnimation(java.lang.String name)
Returns the Animation in the list of Animations under the specified name,
or null if there is none.
|
static Filter |
getFilter(java.lang.String name)
Returns the Filter in the list of Filters under the specified name, or
null if there is none.
|
static Music |
getMusic(java.lang.String name)
Returns the Music track in the list of Music tracks under the specified
name, or null if there is none.
|
static Sound |
getSound(java.lang.String name)
Returns the Sound in the list of Sounds under the specified name, or null
if there is none.
|
static Sprite |
getSprite(java.lang.String name)
Returns the Sprite in the list of Sprites under the specified name, or
null if there is none.
|
static SpriteSheet |
getSpriteSheet(java.lang.String name)
Returns the SpriteSheet in the list of SpriteSheets under the specified
name, or null if there is none.
|
public static final boolean add(java.lang.String name, Filter filter)
name
- The name under which the specified Filter is to be addedfilter
- The Filter to be added to the list of Filterspublic static final boolean add(java.lang.String name, Sprite sprite)
name
- The name under which the specified Sprite is to be addedsprite
- The Sprite to be added to the list of Spritespublic static final boolean add(java.lang.String name, SpriteSheet spriteSheet)
name
- The name under which the specified SpriteSheet is to be addedspriteSheet
- The SpriteSheet to be added to the list of
SpriteSheetspublic static final boolean add(java.lang.String name, Animation animation)
name
- The name under which the specified Animation is to be addedanimation
- The Animation to be added to the list of Animationspublic static final boolean add(java.lang.String name, Sound sound)
name
- The name under which the specified Sound is to be addedsound
- The Sound to be added to the list of Soundspublic static final boolean add(java.lang.String name, Music music)
name
- The name under which the specified Music track is to be addedmusic
- The Music track to be added to the list of Music trackspublic static final Filter getFilter(java.lang.String name)
name
- The name of the Filter to returnpublic static final Sprite getSprite(java.lang.String name)
name
- The name of the Sprite to returnpublic static final SpriteSheet getSpriteSheet(java.lang.String name)
name
- The name of the SpriteSheet to returnpublic static final Animation getAnimation(java.lang.String name)
name
- The name of the Animation to returnpublic static final Sound getSound(java.lang.String name)
name
- The name of the Sound to returnpublic static final Music getMusic(java.lang.String name)
name
- The name of the Music track to return