use of com.badlogic.gdx.graphics.Texture in project AnotherMonekyParadox by SantiagoMille.
the class PantallaTutorial method crearMainView.
private void crearMainView() {
stageMenu = new Stage(vista);
imgBackground = new Texture("pantall_tutorial.png");
spriteBackground = new Sprite(imgBackground);
spriteBackground.setPosition(0, 0);
// spriteBackground.setAlpha(0.7f);
// Boton Return
TextureRegionDrawable trdReturn = new TextureRegionDrawable(new TextureRegion(new Texture("go-back.png")));
ImageButton btnReturn = new ImageButton(trdReturn);
btnReturn.setPosition(30, ALTO - 30 - btnReturn.getHeight());
// Click en boton Return
btnReturn.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
super.clicked(event, x, y);
// Gdx.app.log("ClickListener","Si se clickeoooo");
main.setScreen(new PantallaMenu(main));
}
});
stageMenu.addActor(btnReturn);
Gdx.input.setInputProcessor(stageMenu);
}
use of com.badlogic.gdx.graphics.Texture in project bdx by GoranM.
the class Material method texture.
public Texture texture(String filename) {
Texture tex = currentTexture;
if (!filename.equals(texturePath)) {
tex = new Texture(Gdx.files.internal("bdx/textures/" + filename));
tex.setWrap(Texture.TextureWrap.Repeat, Texture.TextureWrap.Repeat);
texture(tex);
texturePath = filename;
}
return tex;
}
use of com.badlogic.gdx.graphics.Texture in project FruityMod-StS by gskleres.
the class FruityMod method receivePostInitialize.
@Override
public void receivePostInitialize() {
// Mod badge
Texture badgeTexture = new Texture(makePath(BADGE_IMG));
ModPanel settingsPanel = new ModPanel();
settingsPanel.addLabel("FruityMod does not have any settings (yet)!", 400.0f, 700.0f, (me) -> {
});
BaseMod.registerModBadge(badgeTexture, MODNAME, AUTHOR, DESCRIPTION, settingsPanel);
Settings.isDailyRun = false;
Settings.isTrial = false;
Settings.isDemo = false;
}
use of com.badlogic.gdx.graphics.Texture in project ultimate-java by pantinor.
the class AnimationPixMapPacker method updateTextureAtlas.
/**
* Updates the given {@link TextureAtlas}, adding any new {@link Pixmap}
* instances packed since the last call to this method. This can be used to
* insert Pixmap instances on a separate thread via
* {@link #pack(String, Pixmap)} and update the TextureAtlas on the
* rendering thread. This method must be called on the rendering thread.
*/
public synchronized void updateTextureAtlas(TextureAtlas atlas, TextureFilter minFilter, TextureFilter magFilter, boolean useMipMaps) {
for (Page page : pages) {
if (page.texture == null) {
if (page.rects.size != 0 && page.addedRects.size > 0) {
page.texture = new Texture(new PixmapTextureData(page.image, page.image.getFormat(), useMipMaps, false, true)) {
@Override
public void dispose() {
super.dispose();
getTextureData().consumePixmap().dispose();
}
};
page.texture.setFilter(minFilter, magFilter);
for (String name : page.addedRects) {
Rectangle rect = page.rects.get(name);
TextureRegion region = new TextureRegion(page.texture, (int) rect.x, (int) rect.y, (int) rect.width, (int) rect.height);
atlas.addRegion(name, region);
}
page.addedRects.clear();
}
} else {
if (page.addedRects.size > 0) {
page.texture.load(page.texture.getTextureData());
for (String name : page.addedRects) {
Rectangle rect = page.rects.get(name);
TextureRegion region = new TextureRegion(page.texture, (int) rect.x, (int) rect.y, (int) rect.width, (int) rect.height);
atlas.addRegion(name, region);
}
page.addedRects.clear();
return;
}
}
}
}
use of com.badlogic.gdx.graphics.Texture in project ultimate-java by pantinor.
the class DungeonScreen method createMiniMap.
public void createMiniMap() {
if (miniMap != null) {
miniMap.dispose();
}
Pixmap pixmap = new Pixmap(MM_BKGRND_DIM, MM_BKGRND_DIM, Format.RGBA8888);
for (int y = 0; y < DUNGEON_MAP; y++) {
for (int x = 0; x < DUNGEON_MAP; x++) {
DungeonTile tile = dungeonTiles[currentLevel][x][y];
if (tile == DungeonTile.WALL || tile == DungeonTile.SECRET_DOOR) {
pixmap.setColor(0.3f, 0.3f, 0.3f, 0.7f);
pixmap.fillRectangle(OFST + (x * DIM), OFST + (y * DIM), DIM, DIM);
} else if (tile == DungeonTile.DOOR) {
pixmap.setColor(0.6f, 0.6f, 0.6f, 0.7f);
pixmap.fillRectangle(OFST + (x * DIM), OFST + (y * DIM), DIM, DIM);
} else if (tile.getValue() >= 208 && tile.getValue() <= 223) {
// room indicator
pixmap.setColor(0.36f, 0.04f, 0.04f, 0.7f);
pixmap.fillRectangle(OFST + (x * DIM), OFST + (y * DIM), DIM, DIM);
} else if (tile.getValue() >= 160 && tile.getValue() <= 163) {
// fields
Color c = Color.GREEN;
if (tile == DungeonTile.FIELD_ENERGY) {
c = Color.BLUE;
}
if (tile == DungeonTile.FIELD_FIRE) {
c = Color.RED;
}
if (tile == DungeonTile.FIELD_SLEEP) {
c = Color.PURPLE;
}
pixmap.setColor(c);
pixmap.fillRectangle(OFST + (x * DIM), OFST + (y * DIM), DIM, DIM);
} else if (tile.getValue() >= 10 && tile.getValue() <= 48) {
// ladders
drawLadderTriangle(tile, pixmap, x, y);
}
}
}
miniMap = new Texture(pixmap);
pixmap.dispose();
}
Aggregations