Search in sources :

Example 1 with Preferences

use of com.badlogic.gdx.Preferences in project libgdx by libgdx.

the class LwjglAWTCanvas method getPreferences.

@Override
public Preferences getPreferences(String name) {
    if (preferences.containsKey(name)) {
        return preferences.get(name);
    } else {
        Preferences prefs = new LwjglPreferences(name, ".prefs/");
        preferences.put(name, prefs);
        return prefs;
    }
}
Also used : Preferences(com.badlogic.gdx.Preferences)

Example 2 with Preferences

use of com.badlogic.gdx.Preferences in project libgdx by libgdx.

the class HeadlessApplication method getPreferences.

@Override
public Preferences getPreferences(String name) {
    if (preferences.containsKey(name)) {
        return preferences.get(name);
    } else {
        Preferences prefs = new HeadlessPreferences(name, this.preferencesdir);
        preferences.put(name, prefs);
        return prefs;
    }
}
Also used : Preferences(com.badlogic.gdx.Preferences)

Example 3 with Preferences

use of com.badlogic.gdx.Preferences in project libgdx by libgdx.

the class JglfwApplication method getPreferences.

public Preferences getPreferences(String name) {
    if (preferences.containsKey(name))
        return preferences.get(name);
    else {
        Preferences prefs = new JglfwPreferences(name, this.preferencesdir);
        preferences.put(name, prefs);
        return prefs;
    }
}
Also used : Preferences(com.badlogic.gdx.Preferences)

Example 4 with Preferences

use of com.badlogic.gdx.Preferences in project libgdx by libgdx.

the class GwtApplication method getPreferences.

@Override
public Preferences getPreferences(String name) {
    Preferences pref = prefs.get(name);
    if (pref == null) {
        pref = new GwtPreferences(name);
        prefs.put(name, pref);
    }
    return pref;
}
Also used : Preferences(com.badlogic.gdx.Preferences)

Example 5 with Preferences

use of com.badlogic.gdx.Preferences in project libgdx by libgdx.

the class GwtTest method create.

@Override
public void create() {
    Preferences pref = Gdx.app.getPreferences("test");
    boolean resultb = pref.getBoolean("test");
    int resulti = pref.getInteger("test");
    shader = new ShaderProgram(Gdx.files.internal("data/shaders/shader-vs.glsl"), Gdx.files.internal("data/shaders/shader-fs.glsl"));
    if (!shader.isCompiled())
        throw new GdxRuntimeException(shader.getLog());
    mesh = new Mesh(VertexDataType.VertexBufferObject, true, 6, 0, VertexAttribute.Position(), VertexAttribute.TexCoords(0));
    mesh.setVertices(new float[] { -0.5f, -0.5f, 0, 0, 1, 0.5f, -0.5f, 0, 1, 1, 0.5f, 0.5f, 0, 1, 0, 0.5f, 0.5f, 0, 1, 0, -0.5f, 0.5f, 0, 0, 0, -0.5f, -0.5f, 0, 0, 1 });
    texture = new Texture(new Pixmap(Gdx.files.internal("data/badlogic.jpg")), true);
    texture.setFilter(TextureFilter.MipMap, TextureFilter.Linear);
    String params = Gdx.files.internal("data/gwttestparams.txt").readString();
    numSprites = Integer.parseInt(params);
    batch = new SpriteBatch();
    positions = new ArrayList<Vector2>();
    for (int i = 0; i < numSprites; i++) {
        positions.add(new Vector2(MathUtils.random() * Gdx.graphics.getWidth(), MathUtils.random() * Gdx.graphics.getHeight()));
    }
    sprite = new Sprite(texture);
    sprite.setSize(64, 64);
    sprite.setOrigin(32, 32);
    font = new BitmapFont(Gdx.files.internal("data/arial-15.fnt"), false);
    cache = font.newFontCache();
    cache.setColor(Color.RED);
    cache.setText("This is a Test", 0, 0);
    atlas = new TextureAtlas(Gdx.files.internal("data/pack"));
}
Also used : Sprite(com.badlogic.gdx.graphics.g2d.Sprite) Mesh(com.badlogic.gdx.graphics.Mesh) Texture(com.badlogic.gdx.graphics.Texture) SpriteBatch(com.badlogic.gdx.graphics.g2d.SpriteBatch) GdxRuntimeException(com.badlogic.gdx.utils.GdxRuntimeException) ShaderProgram(com.badlogic.gdx.graphics.glutils.ShaderProgram) Vector2(com.badlogic.gdx.math.Vector2) TextureAtlas(com.badlogic.gdx.graphics.g2d.TextureAtlas) Preferences(com.badlogic.gdx.Preferences) BitmapFont(com.badlogic.gdx.graphics.g2d.BitmapFont) Pixmap(com.badlogic.gdx.graphics.Pixmap)

Aggregations

Preferences (com.badlogic.gdx.Preferences)23 SpriteBatch (com.badlogic.gdx.graphics.g2d.SpriteBatch)7 Texture (com.badlogic.gdx.graphics.Texture)5 Sprite (com.badlogic.gdx.graphics.g2d.Sprite)5 Table (com.badlogic.gdx.scenes.scene2d.ui.Table)5 Bala (mx.itesm.another_monkey_paradox.Objetos.Bala)5 Enemigo (mx.itesm.another_monkey_paradox.Objetos.Enemigo)5 Granada (mx.itesm.another_monkey_paradox.Objetos.Granada)5 Fondo (mx.itesm.another_monkey_paradox.Utils.Fondo)5 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)4 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)4 Stage (com.badlogic.gdx.scenes.scene2d.Stage)4 ImageButton (com.badlogic.gdx.scenes.scene2d.ui.ImageButton)4 Label (com.badlogic.gdx.scenes.scene2d.ui.Label)4 Skin (com.badlogic.gdx.scenes.scene2d.ui.Skin)4 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)4 TextureRegionDrawable (com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable)4 File (java.io.File)3 ArrayList (java.util.ArrayList)3 GdxRuntimeException (com.badlogic.gdx.utils.GdxRuntimeException)2