public void showMenu() { continua = new TextButton("CONTINUA", Assets.getInstance().getButtonStyle()); continua.setPosition(100, 400); toMenu = new TextButton("MENIU", Assets.getInstance().getButtonStyle()); group = new Group(); group.setSize(100, 100); group.addActor(continua); group.addActor(toMenu); group.setPosition(100, 400); Table table = new Table(); table.add(continua); table.setPosition(100, 400); // stage.addActor(table); // stage.addActor(continua); }
@Override public void create() { FileHandle fh = Gdx.files.internal("freud.txt"); TextureAtlas atlas = new TextureAtlas(fh); stage = new Stage(); // ======= フロイト ========== TextureAtlas.AtlasRegion fruedRegion = atlas.findRegion("nigaoe_freud"); // Imageクラスにregionを食わせるらしい Image fruedImage = new Image(fruedRegion); fruedImage.setPosition(0, 0); // ステージにActorを突っ込む // Imageはextends Widget。 // Widgetはextends Actor implementes Layout stage.addActor(fruedImage); // stageの直下に追加 // ======= 始皇帝 ========== TextureAtlas.AtlasRegion shikouteiRegion = atlas.findRegion("nigaoe_shikoutei"); Image shikouteiImage = new Image(shikouteiRegion); shikouteiImage.setPosition(200, 0); stage.addActor(shikouteiImage); // stageの直下に追加 // グループを生成する // Groupもextends Actor implemnts Cullable // Cullableはよく分からん // 多分Groupのabilityなんだと思うんだが // 親子関係の描画操作かな Group group = new Group(); group.setPosition(150, 200); group.setScale(0.5f); stage.addActor(group); // ======= 正岡子規 ========== TextureAtlas.AtlasRegion masaokaRegion = atlas.findRegion("nigaoe_masaoka_shiki"); Image masaokaImage = new Image(masaokaRegion); masaokaImage.setPosition(0, 0); group.addActor(masaokaImage); // groupの下に追加 // ======= 石川ゴエモン ========== TextureAtlas.AtlasRegion goemonRegion = atlas.findRegion("nigaoe_ishikawa_goemon"); Image goemonImage = new Image(goemonRegion); goemonImage.setPosition(200, 0); group.addActor(goemonImage); // groupの下に追加 }
@Override public void setPosition(float x, float y) { super.setPosition(x, y); modified = true; }