List of usage examples for com.badlogic.gdx.graphics Color GRAY
Color GRAY
To view the source code for com.badlogic.gdx.graphics Color GRAY.
Click Source Link
From source file:com.andgate.ikou.view.FloorSelectScreen.java
License:Open Source License
public void buildStage() { stage.clear();/*from w w w .j a v a2 s . c o m*/ stage.getViewport().setWorldSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); stage.getViewport().update(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), true); final Label.LabelStyle titleLabelStyle = new Label.LabelStyle(game.menuTitleFont, Color.CYAN); final ShaderLabel titleLabel = new ShaderLabel(SELECT_FLOOR_TEXT, titleLabelStyle, game.fontShader); final Label.LabelStyle floorOptionLabelStyle = new Label.LabelStyle(game.menuOptionFont, Color.BLACK); final Label.LabelStyle lockedFloorOptionLabelStyle = new Label.LabelStyle(game.menuOptionFont, Color.GRAY); Table floorOptionsTable = new Table(); float padding = 0.5f * game.ppm; float actorLength = (float) Gdx.graphics.getWidth() / COLUMNS - padding * 2.0f; for (int floorNumber = 1; floorNumber <= levelData.totalFloors; floorNumber++) { ShaderLabel floorLabel = null; if (floorNumber <= levelData.completedFloors + 1) { floorLabel = new ShaderLabel("" + floorNumber, floorOptionLabelStyle, game.fontShader); floorLabel.addListener(new FloorOptionClickListener(game, this, levelData, floorNumber)); } else { floorLabel = new ShaderLabel("?", lockedFloorOptionLabelStyle, game.fontShader); } floorOptionsTable.add(floorLabel).pad(padding).width(actorLength).height(actorLength).center(); if (floorNumber % COLUMNS == 0) { floorOptionsTable.row(); } } ScrollPane scrollPane = new ScrollPane(floorOptionsTable); Table table = new Table(); table.add(titleLabel).center().top().row(); table.add(scrollPane).fill().expand().top().left(); table.setFillParent(true); stage.addActor(table); stage.setDebugAll(true); }
From source file:com.barconr.games.marblegame.Maze3Drenderer.java
License:Apache License
private void createModels(TiledMap tiledmap) { // Load the Tiled map layer and store some relevant variables TiledMapTileLayer tilelayer = (TiledMapTileLayer) (tiledmap.getLayers().get(0)); layerHeight = tilelayer.getHeight(); layerWidth = tilelayer.getWidth();/*from w ww.j a v a 2s . com*/ tileWidth = tileHeight = CUBE_SIZE; for (int y_pos = 0; y_pos < layerHeight; y_pos++) { for (int x_pos = 0; x_pos < layerWidth; x_pos++) { //boolean impassibleBlock = tilelayer.getCell(x_pos, layerHeight-y_pos-1).getTile().getProperties().containsKey("block"); boolean impassibleBlock = tilelayer.getCell(x_pos, y_pos).getTile().getProperties() .containsKey("block"); if (impassibleBlock) { //Draw a cube here float xcord = x_pos * tileWidth; float ycord = y_pos * tileHeight; addBox(new Vector3(xcord, ycord, 0)); // mazeBuilder.createMazePart(xcord,ycord,0); } } } //Background addBox(new Vector3((layerWidth * tileWidth) / 2, (layerHeight * tileHeight) / 2, -CUBE_SIZE), layerWidth * tileWidth, layerHeight * tileHeight, CUBE_SIZE, Color.GRAY); }
From source file:com.binarytenshi.nopassing.core.SplineHandler.java
public static void drawSplines() { shaper.setProjectionMatrix(CameraHandler.getCamera().combined); shaper.setColor(Color.GRAY); for (Spline spline : splines) { drawSpline(spline);/*from w w w . j av a 2 s . co m*/ } shaper.setColor(Color.BLACK); if (currentSpline != null) { drawSpline(currentSpline); } }
From source file:com.bladecoder.engine.ui.LoadingScreen.java
License:Apache License
@Override public void render(float delta) { // Try to load scene for WAIT_TIME_MS before continue. If not loaded in // this time, // show the loading screen if (wait) {//w ww . ja va2 s. c om float t0 = System.currentTimeMillis(); float t = 0f; while (EngineAssetManager.getInstance().isLoading() && t - t0 < WAIT_TIME_MS) { t = System.currentTimeMillis(); } } if (!EngineAssetManager.getInstance().isLoading()) { ui.setCurrentScreen(Screens.SCENE_SCREEN); return; } Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); // Only show the squares when time > INIT_TIME if (initTime < INIT_TIME_SEG) { initTime += delta; return; } final SpriteBatch batch = ui.getBatch(); batch.setProjectionMatrix(viewport.getCamera().combined); batch.begin(); update(delta); for (int i = 0; i < numSquares; i++) { final Color color = i == pos ? Color.WHITE : Color.GRAY; RectangleRenderer.draw(ui.getBatch(), x + i * (squareWidth + margin), y, squareWidth, squareHeight, color); } batch.end(); }
From source file:com.codefiddler.libgdx.spinit.level.Level1.java
License:Apache License
public Color getSegmentColor() { return Color.GRAY; }
From source file:com.codefiddler.libgdx.tetris.domain.Tetrimino.java
License:Apache License
public static Tetrimino getJ() { return new Tetrimino(J, Color.GRAY); }
From source file:com.dgzt.core.Table.java
License:Open Source License
/** * The constructor./*from w w w . j av a 2 s . c o m*/ * * @param shader - The shader. * @param gameControl - The game control. */ public Table(final ShaderProgram shader, final GameControl gameControl) { super(shader, Color.GRAY); box2DWorld = new World(new Vector2(0, 0), true); final EventListener eventListener = new EventListener(this, gameControl); box2DWorld.setContactListener(eventListener); addBox2DWalls(); map = new Map(shader, box2DWorld, (Table.WIDTH - Map.WIDTH) / 2, (Table.HEIGHT - Map.HEIGHT) / 2); leftGate = new LeftGate(shader, box2DWorld, (Table.WIDTH - Map.WIDTH) / 2 - LeftGate.WIDTH + LineShape.LINE_WIDTH, (Table.HEIGHT - LeftGate.HEIGHT) / 2); rightGate = new RightGate(shader, box2DWorld, Table.WIDTH - (Table.WIDTH - Map.WIDTH) / 2 - LineShape.LINE_WIDTH, (Table.HEIGHT - RightGate.HEIGHT) / 2); playerButtons = new ArrayList<Button>(); opponentButtons = new ArrayList<Button>(); addButtons(shader, eventListener); ball = new Ball(this, shader, eventListener, box2DWorld, Table.WIDTH / 2, Table.HEIGHT / 2); arrow = new Arrow(this, shader); }
From source file:com.gamemaker.gameworld.GameRenderer.java
License:Apache License
public void drawGameOver(float delta) { AssetLoader.backgroundMusic.stop();//from w w w . j av a 2 s . com AssetLoader.monsterMusic.stop(); AssetLoader.yell.stop(); AssetLoader.dangerous.stop(); AssetLoader.monsterSound.stop(); AssetLoader.startSound.stop(); AssetLoader.billycanSound.stop(); AssetLoader.waterSound.stop(); AssetLoader.bushonionSound.stop(); AssetLoader.rockSound1.stop(); AssetLoader.rockSound2.stop(); AssetLoader.backgroundMusicLev2.stop(); tempRunTimeGameOver += delta; shapeRenderer.begin(ShapeType.Filled); shapeRenderer.setColor(Color.GRAY); shapeRenderer.rect(0, 0, 1280, 720); shapeRenderer.end(); batcher.begin(); font.getData().setScale(5f, -5f); font.setColor(Color.WHITE); //if (myWorld.getMonster().getMonsterGo() == 1 || myWorld.getKingbrown1().collides(myWorld.getPlayer()) || myWorld.getKingbrown2().collides(myWorld.getPlayer()) || myWorld.getWater() <= 0 || myWorld.collideStone()) { if (deathSoundPlay) { AssetLoader.die.play(); deathSoundPlay = false; } layout.setText(font4, "Ngarlpu wiyarringu"); font4.draw(batcher, layout, 280, 120); if (playerDeath.getKeyFrameIndex(tempRunTimeGameOver) == 2) { flagDeath = false; } if (flagDeath) { batcher.draw(playerDeath.getKeyFrame(tempRunTimeGameOver), 500, 400); } else { batcher.draw(AssetLoader.death3, 500, 550); } Gdx.app.log("drawGameOver", "called"); //} /*else if (myWorld.getMonster().getMonsterGo() == 2) { font.draw(batcher, "You Win", 554, 250); font.draw(batcher, "Touch The Screen", 370, 380); }*/ font.getData().setScale(1f, -1f); drawButton(); batcher.end(); }
From source file:com.jupiter.europa.screen.MainMenuScreen.java
License:Open Source License
private static void buildMainMenuSkin() { Skin skin = new Skin(); // Fonts/* ww w. j a va 2 s . c om*/ skin.add(BUTTON_FONT_KEY, EuropaGame.game.getAssetManager() .get(FileLocations.FONTS_DIRECTORY.resolve(BUTTON_FONT).toString())); skin.add(TITLE_FANCY_FONT_KEY, EuropaGame.game.getAssetManager() .get(FileLocations.FONTS_DIRECTORY.resolve(TITLE_FANCY_FONT).toString())); skin.add(TITLE_FONT_KEY, EuropaGame.game.getAssetManager() .get(FileLocations.FONTS_DIRECTORY.resolve(TITLE_FONT).toString())); skin.add(LIST_FONT_KEY, EuropaGame.game.getAssetManager().get(FileLocations.FONTS_DIRECTORY.resolve(LIST_FONT).toString())); skin.add(TEXT_FIELD_FONT_KEY, EuropaGame.game.getAssetManager() .get(FileLocations.FONTS_DIRECTORY.resolve(TEXT_FIELD_FONT).toString())); skin.add(INFO_LABEL_FONT_KEY, EuropaGame.game.getAssetManager() .get(FileLocations.FONTS_DIRECTORY.resolve(INFO_LABEL_FONT).toString())); // Set the background texture Pixmap pixmap = new Pixmap(1, (int) 1, Pixmap.Format.RGB888); pixmap.setColor(Color.WHITE); pixmap.fill(); skin.add(SOLID_TEXTURE_KEY, new Texture(pixmap)); Drawable transparentDrawable = skin.newDrawable(SOLID_TEXTURE_KEY, TRANSPARENT); // Get values from the atlas skin.addRegions( EuropaGame.game.getAssetManager().get(MAIN_MENU_SKIN_DIRECTORY.resolve(ATLAS_KEY).toString())); // Colors Color textButtonFontColor = new Color(0.85f, 0.85f, 0.85f, 1.0f); // Set images Drawable textButtonBackground = new TextureRegionDrawable( skin.get(BUTTON_BACKGROUND_KEY, TextureRegion.class)); textButtonBackground.setLeftWidth(32); textButtonBackground.setRightWidth(32); textButtonBackground.setTopHeight(5); textButtonBackground.setBottomHeight(5); skin.add(BUTTON_BACKGROUND_KEY, textButtonBackground); Drawable textButtonBackgroundDown = new TextureRegionDrawable( skin.get(BUTTON_DOWN_KEY, TextureRegion.class)); textButtonBackgroundDown.setLeftWidth(32); textButtonBackgroundDown.setRightWidth(32); textButtonBackgroundDown.setTopHeight(5); textButtonBackgroundDown.setBottomHeight(5); skin.add(BUTTON_DOWN_KEY, textButtonBackgroundDown); Drawable listSelection = new TextureRegionDrawable(skin.get(LIST_SELECTION_KEY, TextureRegion.class)); listSelection.setLeftWidth(7); listSelection.setRightWidth(7); listSelection.setTopHeight(0); listSelection.setBottomHeight(0); skin.add(LIST_SELECTION_KEY, listSelection); Drawable tabButtonBackground = new TextureRegionDrawable( skin.get(TAB_BUTTON_BACKGROUND_KEY, TextureRegion.class)); tabButtonBackground.setLeftWidth(5); tabButtonBackground.setRightWidth(5); tabButtonBackground.setTopHeight(0); tabButtonBackground.setBottomHeight(0); skin.add(TAB_BUTTON_BACKGROUND_KEY, tabButtonBackground); Drawable tabButtonBackgroundSelected = new TextureRegionDrawable( skin.get(TAB_BUTTON_SELECTED_KEY, TextureRegion.class)); tabButtonBackgroundSelected.setLeftWidth(5); tabButtonBackgroundSelected.setRightWidth(5); tabButtonBackgroundSelected.setTopHeight(0); tabButtonBackgroundSelected.setBottomHeight(0); skin.add(TAB_BUTTON_SELECTED_KEY, tabButtonBackgroundSelected); Drawable titleBackground = new TextureRegionDrawable(skin.get(TITLE_BACKGROUND_KEY, TextureRegion.class)); titleBackground.setLeftWidth(10); titleBackground.setRightWidth(10); titleBackground.setTopHeight(0); titleBackground.setBottomHeight(0); skin.add(TITLE_BACKGROUND_KEY, titleBackground); Drawable numberIncreaseDrawable = new TextureRegionDrawable( skin.get(NUMBER_SELECTOR_INCREASE_KEY, TextureRegion.class)); numberIncreaseDrawable.setLeftWidth(0); numberIncreaseDrawable.setRightWidth(0); numberIncreaseDrawable.setTopHeight(0); numberIncreaseDrawable.setBottomHeight(0); skin.add(NUMBER_SELECTOR_INCREASE_KEY, numberIncreaseDrawable); Drawable numberDecreaseDrawable = new TextureRegionDrawable( skin.get(NUMBER_SELECTOR_DECREASE_KEY, TextureRegion.class)); numberDecreaseDrawable.setLeftWidth(0); numberDecreaseDrawable.setRightWidth(0); numberDecreaseDrawable.setTopHeight(0); numberDecreaseDrawable.setBottomHeight(0); skin.add(NUMBER_SELECTOR_DECREASE_KEY, numberDecreaseDrawable); skin.add(DIALOG_BACKGROUND_KEY, skin.newDrawable(new TextureRegionDrawable(skin.get(DIALOG_BACKGROUND_KEY, TextureRegion.class)), new Color(1.0f, 1.0f, 1.0f, 1.0f))); skin.add(POPUP_BACKGROUND_KEY, skin.newDrawable(new TextureRegionDrawable(skin.get(POPUP_BACKGROUND_KEY, TextureRegion.class)), new Color(1.0f, 1.0f, 1.0f, 1.0f))); skin.add(LIST_BACKGROUND_KEY, skin.newDrawable(new TextureRegionDrawable(skin.get(LIST_BACKGROUND_KEY, TextureRegion.class)), new Color(1.0f, 1.0f, 1.0f, 1.0f))); skin.add(LIST_SELECTION_KEY, skin.newDrawable(new TextureRegionDrawable(skin.get(LIST_SELECTION_KEY, TextureRegion.class)), new Color(1.0f, 1.0f, 1.0f, 1.0f))); skin.add(CREDITS_BACKGROUND_KEY, skin.newDrawable(new TextureRegionDrawable(skin.get(CREDITS_BACKGROUND_KEY, TextureRegion.class)), new Color(1.0f, 1.0f, 1.0f, 1.0f))); Drawable dropdownListBackground = skin.newDrawable( new TextureRegionDrawable(skin.get(DROP_DOWN_LIST_BACKGROUND, TextureRegion.class)), new Color(1, 1, 1, 1)); dropdownListBackground.setLeftWidth(28); dropdownListBackground.setRightWidth(28); dropdownListBackground.setTopHeight(0); dropdownListBackground.setBottomHeight(0); skin.add(DROP_DOWN_LIST_BACKGROUND, dropdownListBackground); // Create a Label style for the title Label.LabelStyle titleStyle = new Label.LabelStyle(); titleStyle.background = transparentDrawable; titleStyle.font = skin.getFont(TITLE_FONT_KEY); titleStyle.fontColor = new Color(Color.BLACK); skin.add(DEFAULT_KEY, titleStyle); // Fancy Character Label Style Label.LabelStyle fancyTitleStyle = new Label.LabelStyle(); fancyTitleStyle.background = transparentDrawable; fancyTitleStyle.font = skin.getFont(TITLE_FANCY_FONT_KEY); fancyTitleStyle.fontColor = new Color(Color.BLACK); skin.add(FANCY_KEY, fancyTitleStyle); // Create a Label style for dialogs LabelStyle infoStyle = new LabelStyle(); infoStyle.background = transparentDrawable; infoStyle.font = skin.getFont(INFO_LABEL_FONT_KEY); infoStyle.fontColor = new Color(Color.BLACK); skin.add(INFO_STYLE_KEY, infoStyle); // Default Button Style TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle(); textButtonStyle.up = textButtonBackground; textButtonStyle.down = textButtonBackgroundDown; textButtonStyle.checked = textButtonBackground; textButtonStyle.over = textButtonBackgroundDown; textButtonStyle.disabled = textButtonBackground; textButtonStyle.font = skin.getFont(BUTTON_FONT_KEY); textButtonStyle.fontColor = textButtonFontColor; textButtonStyle.disabledFontColor = new Color(0.3f, 0.3f, 0.3f, 1.0f); // textButtonStyle.pressedOffsetX = 2f; // textButtonStyle.pressedOffsetY = -3f; skin.add(DEFAULT_KEY, textButtonStyle); // Tab Button Style TextButtonStyle tabButtonStyle = new TextButtonStyle(); tabButtonStyle.up = tabButtonBackground; tabButtonStyle.down = tabButtonBackground; tabButtonStyle.checked = tabButtonBackgroundSelected; tabButtonStyle.over = tabButtonBackground; tabButtonStyle.disabled = tabButtonBackground; tabButtonStyle.font = skin.getFont(BUTTON_FONT_KEY); tabButtonStyle.fontColor = textButtonFontColor; tabButtonStyle.overFontColor = textButtonFontColor; tabButtonStyle.disabledFontColor = new Color(Color.GRAY); skin.add(TAB_STYLE_KEY, tabButtonStyle); // Create a TextField style TextFieldStyle textFieldStyle = new TextFieldStyle(); textFieldStyle.background = skin.newDrawable(SOLID_TEXTURE_KEY, new Color(0f, 0f, 0f, 0.1f)); textFieldStyle.selection = skin.newDrawable(SOLID_TEXTURE_KEY, new Color(0f, 0f, 1f, 0.3f)); textFieldStyle.cursor = skin.newDrawable(SOLID_TEXTURE_KEY, Color.BLACK); textFieldStyle.font = skin.getFont(TEXT_FIELD_FONT_KEY); textFieldStyle.fontColor = Color.BLACK; skin.add(DEFAULT_KEY, textFieldStyle); // Create a List style ListStyle listStyle = new ListStyle(); listStyle.font = skin.getFont(LIST_FONT_KEY); listStyle.fontColorSelected = Color.BLACK; listStyle.fontColorUnselected = Color.BLACK; listStyle.selection = listSelection; listStyle.background = transparentDrawable; skin.add(DEFAULT_KEY, listStyle); // Create a Scroll Pane Style ScrollPaneStyle scrollPaneStyle = new ScrollPaneStyle(); scrollPaneStyle.background = transparentDrawable; // scrollPaneStyle.vScroll = skin.newDrawable(MainMenuScreen.SCROLL_BAR_VERTICAL_KEY); // scrollPaneStyle.vScrollKnob = skin.newDrawable(MainMenuScreen.SCROLL_BAR_VERTICAL_KNOB_KEY); skin.add(DEFAULT_KEY, scrollPaneStyle); // Create a Dialog Style WindowStyle dialogStyle = new WindowStyle(); dialogStyle.background = new SpriteDrawable( new Sprite(EuropaGame.game.getAssetManager().get(BACKGROUND_FILE_NAME, Texture.class))); dialogStyle.titleFont = skin.getFont(TITLE_FONT_KEY); dialogStyle.titleFontColor = new Color(Color.BLACK); skin.add(DEFAULT_KEY, dialogStyle); // Popup Dialog Style WindowStyle popupStyle = new WindowStyle(); popupStyle.titleFont = skin.getFont(TITLE_FONT_KEY); popupStyle.titleFontColor = new Color(Color.BLACK); skin.add(POPUP_DIALOG_STYLE_KEY, popupStyle); // Create a Slider Skin SliderStyle sliderStyle = new SliderStyle(); sliderStyle.background = new TextureRegionDrawable(skin.get(SLIDER_BACKGROUND_KEY, TextureRegion.class)); sliderStyle.knob = new TextureRegionDrawable(skin.get(SLIDER_KNOB_KEY, TextureRegion.class)); skin.add(DEFAULT_KEY, sliderStyle); // Create a Drop Down Menu Skin SelectBoxStyle selectBoxStyle = new SelectBoxStyle(); selectBoxStyle.background = textButtonBackground; selectBoxStyle.backgroundOpen = textButtonBackgroundDown; selectBoxStyle.backgroundOver = textButtonBackgroundDown; selectBoxStyle.scrollStyle = scrollPaneStyle; selectBoxStyle.font = skin.getFont(TEXT_FIELD_FONT_KEY); selectBoxStyle.fontColor = textButtonFontColor; ListStyle selectBoxListStyle = new ListStyle(); selectBoxListStyle.font = skin.getFont(LIST_FONT_KEY); selectBoxListStyle.fontColorSelected = textButtonFontColor; selectBoxListStyle.fontColorUnselected = textButtonFontColor; selectBoxListStyle.selection = skin.newDrawable(SOLID_TEXTURE_KEY, SELECTION_COLOR); selectBoxListStyle.background = dropdownListBackground; selectBoxStyle.listStyle = selectBoxListStyle; skin.add(DEFAULT_KEY, selectBoxStyle); // NumberSelectorStyle NumberSelectorStyle numberStyle = new NumberSelectorStyle(); numberStyle.decrease = numberDecreaseDrawable; numberStyle.increase = numberIncreaseDrawable; numberStyle.minimumNumberSize = 50; numberStyle.numberLabelStyle = infoStyle; numberStyle.spacing = COMPONENT_SPACING; skin.add(DEFAULT_KEY, numberStyle); // AttributeSelectorStyle MultipleNumberSelectorStyle attrStyle = new MultipleNumberSelector.MultipleNumberSelectorStyle(); attrStyle.labelStyle = infoStyle; attrStyle.numberSelectorStyle = numberStyle; attrStyle.spacing = COMPONENT_SPACING; skin.add(DEFAULT_KEY, attrStyle); mainMenuSkin = skin; }
From source file:com.jupiter.europa.screen.overlay.PauseMenu.java
License:Open Source License
private static void buildPauseMenuSkin() { Skin skin = new Skin(); skin.add("button-font", EuropaGame.game.getAssetManager() .get(FileLocations.FONTS_DIRECTORY.resolve(BUTTON_FONT).toString())); skin.add("title-font", EuropaGame.game.getAssetManager() .get(FileLocations.FONTS_DIRECTORY.resolve(TITLE_FONT).toString())); // Set the background texture Pixmap pixmap = new Pixmap(1, (int) 1, Pixmap.Format.RGB888); pixmap.setColor(Color.WHITE); pixmap.fill();/*from ww w. j a v a 2 s . c o m*/ skin.add("background", new Texture(pixmap)); // Create a Label style for the title Label.LabelStyle titleStyle = new Label.LabelStyle(); titleStyle.background = skin.newDrawable("background", TRANSPARENT); titleStyle.font = skin.getFont("title-font"); titleStyle.fontColor = Color.BLACK; skin.add("default", titleStyle); //Create a button style TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle(); textButtonStyle.up = skin.newDrawable("background", TRANSPARENT); textButtonStyle.down = skin.newDrawable("background", TRANSPARENT); textButtonStyle.checked = skin.newDrawable("background", TRANSPARENT); textButtonStyle.over = skin.newDrawable("background", TRANSPARENT); textButtonStyle.disabled = skin.newDrawable("background", TRANSPARENT); textButtonStyle.font = skin.getFont("button-font"); textButtonStyle.fontColor = Color.TEAL; textButtonStyle.overFontColor = Color.YELLOW; textButtonStyle.disabledFontColor = Color.GRAY; textButtonStyle.pressedOffsetX = 2f; textButtonStyle.pressedOffsetY = -3f; skin.add("default", textButtonStyle); // // skin = EmergenceGame.game.getAssetManager().get( // new File(FileLocations.SKINS_DIRECTORY, "main_menu.skin").getPath()); pauseMenuSkin = skin; }