summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/gdx/boardgame/Assets.java
blob: 690c547ad7a9d76340272776f8257fbf819876fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package ch.asynk.gdx.boardgame;

import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.NinePatch;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.graphics.g2d.TextureRegion;

public class Assets extends AssetManager
{
    public Texture getTexture(String assetName)
    {
        return get(assetName, Texture.class);
    }

    public TextureRegion getTextureRegion(String assetName)
    {
        return new TextureRegion(get(assetName, Texture.class));
    }

    public NinePatch getNinePatch(String assetName, int left, int right, int top, int bottom)
    {
        return new NinePatch(get(assetName, Texture.class), left, right, top, bottom);
    }

    public TextureAtlas getAtlas(String assetName)
    {
        return get(assetName, TextureAtlas.class);
    }

    public BitmapFont getFont(String assetName)
    {
        return get(assetName, BitmapFont.class);
    }

    public Sound getSound(String assetName)
    {
        return get(assetName, Sound.class);
    }
}