use of org.asassecreations.voxelgame.state.MenuState in project Voxel_Game by ASasseCreations.
the class MenuGuiSystem method init.
public static final void init(final MenuState state) {
menuContainer = new GuiPanel(0f, 0f, .8f, .8f, new Color(0f, 0f, 0f, .75f));
startButton = new GuiButton(0f, .5f, .5f, .1f, data -> state.manager().push(new GameState(100)), menuContainer);
settingsButton = new GuiButton(0f, 0f, .5f, .1f, data -> {
}, menuContainer);
quitButton = new GuiButton(0f, -.5f, .5f, .1f, data -> state.manager().pop(), menuContainer);
text = new SoftwareImage((int) startButton.getScreenWidth(), (int) startButton.getScreenHeight());
text.clear();
text.graphics().setFont(new Font("Arial", Font.PLAIN, 32));
text.centerString("Start", Color.WHITE, null);
startImage = new GuiImage(0f, 0f, 1f, 1f, text.toTexture(null), startButton);
text.clear();
text.graphics().setFont(new Font("Arial", Font.PLAIN, 32));
text.centerString("Settings", Color.WHITE, null);
settingsImage = new GuiImage(0f, 0f, 1f, 1f, text.toTexture(null), settingsButton);
text.clear();
text.graphics().setFont(new Font("Arial", Font.PLAIN, 32));
text.centerString("Quit", Color.WHITE, null);
quitImage = new GuiImage(0f, 0f, 1f, 1f, text.toTexture(null), quitButton);
menuContainer.add();
}
use of org.asassecreations.voxelgame.state.MenuState in project Voxel_Game by ASasseCreations.
the class VoxelGame method init.
public final void init() {
try {
AssetLoader.loadOriginalTextures();
AssetLoader.loadModifiedTextures();
ChunkModel.getTexture(AssetLoader.getTextureAtlasSize());
final AtlasResult result = AssetLoader.createAtlas();
TEXTURE_ATLAS = result.image;
AssetLoader.loadItems();
Block.BLOCKS = AssetLoader.loadBlocks(result.textures);
result.textures.clear();
} catch (final IOException | URISyntaxException e) {
e.printStackTrace();
}
manager.push(new MenuState());
}
Aggregations