List of usage examples for com.badlogic.gdx.graphics Color LIGHT_GRAY
Color LIGHT_GRAY
To view the source code for com.badlogic.gdx.graphics Color LIGHT_GRAY.
Click Source Link
From source file:com.finalproject.MainGame.MenuScreen.java
public void create() { // play the start screen sound AssetManager.splash.play();/*from w w w. java 2 s .c o m*/ batch = new SpriteBatch(); stage = new Stage(); Gdx.input.setInputProcessor(stage); skin = new Skin(); // Generate a 1x1 white texture and store it in the skin named "black". Pixmap pixmap = new Pixmap(100, 75, Format.RGBA8888); pixmap.setColor(Color.BLACK); pixmap.fill(); skin.add("black", new Texture(pixmap)); BitmapFont bfont = new BitmapFont(); BitmapFont titleFont = new BitmapFont(); titleFont.getData().setScale(1); bfont.getData().setScale(1); skin.add("default", bfont); TextButtonStyle textButtonStyle = new TextButtonStyle(); textButtonStyle.up = skin.newDrawable("black", Color.DARK_GRAY); textButtonStyle.down = skin.newDrawable("black", Color.DARK_GRAY); textButtonStyle.checked = skin.newDrawable("black", Color.BLUE); textButtonStyle.over = skin.newDrawable("black", Color.LIGHT_GRAY); LabelStyle textLabelStyle = new LabelStyle(); textLabelStyle.font = skin.getFont("default"); textButtonStyle.font = skin.getFont("default"); // Import the fonts for the start button and the instructions skin.add("default", textButtonStyle); skin.add("default", textLabelStyle); // Add the start button and instructions labels final TextButton textButton = new TextButton("Start", textButtonStyle); final Label title = new Label("Call of Duty Ghosts - NAWN Edition", textLabelStyle); final Label Instructions = new Label(" W, A, S, D keys to move the player around ", textLabelStyle); final Label Instructions2 = new Label(" Left click to shoot ", textLabelStyle); //set the position of the start button and the instructions labels title.setPosition(210, 400); Instructions.setPosition(190, 150); Instructions2.setPosition(280, 100); textButton.setPosition(275, 300); //import the buttons and labels into the gameScreen stage.addActor(title); stage.addActor(Instructions); stage.addActor(Instructions2); stage.addActor(textButton); //add a listener to determine when the start button has been Clicked textButton.addListener(new ChangeListener() { public void changed(ChangeEvent event, Actor actor) { //When the start button has been clicked // remove the start button // start the game // turn of the start screen music textButton.remove(); g.setScreen(new MainGame(g)); AssetManager.splash.dispose(); } }); }
From source file:com.finalproject.MainGame.WinScreen.java
public void create() { batch = new SpriteBatch(); stage = new Stage(); Gdx.input.setInputProcessor(stage);//from w w w . j a v a2s.c o m skin = new Skin(); // Generate a 1x1 white texture and store it in the skin named "black". Pixmap pixmap = new Pixmap(100, 75, Format.RGBA8888); pixmap.setColor(Color.BLACK); pixmap.fill(); skin.add("black", new Texture(pixmap)); BitmapFont bfont = new BitmapFont(); BitmapFont titleFont = new BitmapFont(); titleFont.getData().setScale(1); bfont.getData().setScale(1); skin.add("default", bfont); TextButtonStyle textButtonStyle = new TextButtonStyle(); textButtonStyle.up = skin.newDrawable("black", Color.DARK_GRAY); textButtonStyle.down = skin.newDrawable("black", Color.DARK_GRAY); textButtonStyle.checked = skin.newDrawable("black", Color.BLUE); textButtonStyle.over = skin.newDrawable("black", Color.LIGHT_GRAY); LabelStyle textLabelStyle = new LabelStyle(); textLabelStyle.font = skin.getFont("default"); textButtonStyle.font = skin.getFont("default"); // Import the fonts for the Win label skin.add("default", textButtonStyle); skin.add("default", textLabelStyle); // Add the Win screen Label final Label title = new Label(" Y o u W i n! ", textLabelStyle); title.setPosition(265, 300); stage.addActor(title); }
From source file:com.jmstudios.pointandhit.TargetManager.java
License:Open Source License
public TargetManager(float targetLifeTime, int targetRadius, Vector2 screenSize, UserPointer userPointer, GameScreen screen) {// w w w .j a v a 2s. co m this.screen = screen; this.targetLifeTime = targetLifeTime; this.targetRadius = targetRadius; this.userPointer = userPointer; this.shoot = false; this.screenX = (int) screenSize.x; this.screenY = (int) screenSize.y; int targetRadiusBound = targetRadius / 2; lowerX = targetRadiusBound; lowerY = targetRadiusBound; higherX = screenX - targetRadiusBound; higherY = screenY - targetRadiusBound; this.randomGenerator = new Random(); spawnNewTarget(); this.bulletManager = new BulletManager(0.4f, this, userPointer); this.loseLifeEffect = new LoseLifeEffect(0.4f, this); // Theme blueTheme = new GameTheme(); blueTheme.background = new Color(0.2f, 0.4f, 0.5f, 1); blueTheme.target = new Color(0.9f, 0.35f, 0.1f, 1); blueTheme.userPointer = Color.WHITE; blueTheme.bullet = Color.LIGHT_GRAY; purpleTheme = new GameTheme(); purpleTheme.background = new Color(0.2f, 0.2f, 0.5f, 1); purpleTheme.target = new Color(0.87f, 0.58f, 0.85f, 1); purpleTheme.userPointer = Color.WHITE; purpleTheme.bullet = Color.LIGHT_GRAY; darkBlueTheme = new GameTheme(); darkBlueTheme.background = new Color(0.235f, 0.235f, 0.39f, 1); darkBlueTheme.target = new Color(0.39f, 0.69f, 0.29f, 1); darkBlueTheme.userPointer = Color.WHITE; darkBlueTheme.bullet = Color.LIGHT_GRAY; brownTheme = new GameTheme(); brownTheme.background = new Color(0.45f, 0.28f, 0.24f, 1); brownTheme.target = new Color(0.51f, 0.75f, 0.81f, 1); brownTheme.userPointer = Color.WHITE; brownTheme.bullet = Color.LIGHT_GRAY; greenTheme = new GameTheme(); greenTheme.background = new Color(0.34f, 0.53f, 0.27f, 1); greenTheme.target = new Color(0.42f, 0.33f, 0.55f, 1); greenTheme.userPointer = Color.WHITE; greenTheme.bullet = Color.LIGHT_GRAY; this.score = 0; this.currentTheme = getTheme(score); this.lifes = 3; }
From source file:com.jmstudios.pointandhit.TutorialScreen.java
License:Open Source License
public TutorialScreen(final OneShotGame game, boolean automatic) { this.game = game; this.automatic = automatic; this.scale = game.scale; batch = new SpriteBatch(); shapeRenderer = new ShapeRenderer(); screenSize = new Vector2(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); textFont = new BitmapFont(Gdx.files.internal("fonts/deja_vu_sans_medium.fnt")); textFont.setScale(scale);//from www . j a va 2s . com infoLabelStyle = new Label.LabelStyle(textFont, Color.WHITE); tapToLabelStyle = new Label.LabelStyle(textFont, Color.LIGHT_GRAY); // Step 1 float padding = 50 * scale; step1Stage = new Stage(); step1Table = new Table(); step1Table.setFillParent(true); step1Table.align(Align.bottomLeft); step1TiltInfo = new Label(tiltInfo, infoLabelStyle); step1TiltInfo.setWrap(true); step1TiltInfo.setWidth(screenSize.x - padding * 2); step1TiltInfo.setAlignment(Align.center); step1TapInfo = new Label(tapInfo, infoLabelStyle); step1TapInfo.setWrap(true); step1TapInfo.setWidth(screenSize.x - padding * 2); step1TapInfo.setAlignment(Align.center); step1TapToContinue = new Label(tapToContinue, tapToLabelStyle); step1TapToContinue.setWrap(true); step1TapToContinue.setWidth(screenSize.x - padding * 2); step1TapToContinue.setAlignment(Align.center); step1Table.defaults().pad(padding); step1Table.add(step1TiltInfo).width(screenSize.x - padding * 2); step1Table.row(); step1Table.add(step1TapInfo).width(screenSize.x - padding * 2); step1Table.row(); step1Table.add(step1TapToContinue).width(screenSize.x - padding * 2); step1Stage.addActor(step1Table); // Step 2 step2Stage = new Stage(); step2Table = new Table(); step2Table.setFillParent(true); step2Table.align(Align.bottomLeft); step2ObjectiveInfo = new Label(objectiveInfo, infoLabelStyle); step2ObjectiveInfo.setWrap(true); step2ObjectiveInfo.setWidth(screenSize.x - padding * 2); step2ObjectiveInfo.setAlignment(Align.center); step2ShootToContinue = new Label(shootToContinueInfo, tapToLabelStyle); step2ShootToContinue.setWrap(true); step2ShootToContinue.setWidth(screenSize.x - padding * 2); step2ShootToContinue.setAlignment(Align.center); step2Table.defaults().pad(padding); step2Table.add(step2ObjectiveInfo).width(screenSize.x - padding * 2); step2Table.row(); step2Table.add(step2ShootToContinue).width(screenSize.x - padding * 2); step2Stage.addActor(step2Table); // Done doneStage = new Stage(); doneTable = new Table(); doneTable.setFillParent(true); doneTable.align(Align.left); doneEndMessage = new Label(endMessage, infoLabelStyle); doneEndMessage.setWrap(true); doneEndMessage.setWidth(screenSize.x - padding * 2); doneEndMessage.setAlignment(Align.center); if (automatic) { tapToPlay = "Tap to finish..."; } doneTapToInfo = new Label(tapToPlay, tapToLabelStyle); doneTapToInfo.setWrap(true); doneTapToInfo.setWidth(screenSize.x - padding * 2); doneTapToInfo.setAlignment(Align.center); doneTable.defaults().pad(padding); doneTable.add(doneEndMessage).width(screenSize.x - padding * 2); doneTable.row(); doneTable.add(doneTapToInfo).width(screenSize.x - padding * 2); doneStage.addActor(doneTable); }
From source file:com.jupiter.europa.screen.overlay.PauseMenu.java
License:Open Source License
public PauseMenu() { super(true); this.setTint(Color.LIGHT_GRAY); }
From source file:com.kotcrab.vis.editor.module.scene.RendererModule.java
License:Apache License
@Override public void render(Batch batch) { batch.end();/*from w w w . j a va 2 s . co m*/ shapeRenderer.setProjectionMatrix(camera.getCombinedMatrix()); shapeRenderer.setColor(Color.LIGHT_GRAY); shapeRenderer.begin(ShapeType.Line); shapeRenderer.rect(0, 0, scene.width, scene.height); shapeRenderer.end(); batch.begin(); }
From source file:com.kotcrab.vis.editor.ui.IndeterminateTextField.java
License:Apache License
private void updateText() { if (indeterminate) { textField.setText("<?>"); textField.getStyle().fontColor = Color.LIGHT_GRAY; } else {//www. ja v a 2 s . c om textField.setText(text); textField.getStyle().fontColor = Color.WHITE; } }
From source file:com.laststandstudio.space.Levels.Menus.MainMenu.java
License:Open Source License
public MainMenu(Game game) { super(game);//from w w w . j a v a 2 s .c o m SpaceShooter.mode = SpaceShooter.GameMode.MENU_MAIN; SpaceShooter.logger.logDebug("Main Menu: Creating Main Menu Screen"); this.batch = new SpriteBatch(); this.titleFont = super.loadFont("fonts/Gtek_Technology_free.ttf", (Gdx.graphics.getHeight() / 12)); SpaceShooter.logger.logDebug("Main Menu: Creating Button Tables & Fonts"); this.menuFont = new BitmapFont(); this.pixmap = new Pixmap((Gdx.graphics.getWidth() / 2) - (Gdx.graphics.getWidth() / 10), (Gdx.graphics.getHeight() / 12), Pixmap.Format.RGB888); this.skin = new Skin(); this.stage = new Stage(); this.table = new Table(); this.labelStyle = new Label.LabelStyle(titleFont, Color.BLACK); this.textButtonStyle = new TextButton.TextButtonStyle(); skin.add("default", menuFont); pixmap.setColor(Color.MAROON); pixmap.fill(); skin.add("background", new Texture(pixmap)); SpaceShooter.logger.logDebug("Main Menu: Building Button Style"); textButtonStyle.up = skin.newDrawable("background", Color.GRAY); textButtonStyle.down = skin.newDrawable("background", Color.DARK_GRAY); textButtonStyle.checked = skin.newDrawable("background", Color.DARK_GRAY); textButtonStyle.over = skin.newDrawable("background", Color.LIGHT_GRAY); textButtonStyle.font = skin.getFont("default"); skin.add("default", textButtonStyle); SpaceShooter.logger.logDebug("Main Menu: Building Buttons"); this.title = new Label("space shooter", labelStyle); this.btnSinglePlayer = new TextButton("Single Player", skin); this.btnMultiplayer = new TextButton("Multiplayer", skin); this.btnOptions = new TextButton("Options", skin); this.btnTexturePacks = new TextButton("Texture Packs", skin); this.btnMods = new TextButton("Mods", skin); this.btnExit = new TextButton("Exit", skin); }
From source file:com.mbrlabs.mundus.editor.utils.UsefulMeshs.java
License:Apache License
public static Model createAxes() { final float GRID_MIN = -10f; final float GRID_MAX = 10f; final float GRID_STEP = 1f; ModelBuilder modelBuilder = new ModelBuilder(); modelBuilder.begin();//from ww w . j a v a 2 s.co m MeshPartBuilder builder = modelBuilder.part("grid", GL20.GL_LINES, VertexAttributes.Usage.Position | VertexAttributes.Usage.ColorUnpacked, new Material()); builder.setColor(Color.LIGHT_GRAY); for (float t = GRID_MIN; t <= GRID_MAX; t += GRID_STEP) { builder.line(t, 0, GRID_MIN, t, 0, GRID_MAX); builder.line(GRID_MIN, 0, t, GRID_MAX, 0, t); } builder = modelBuilder.part("axes", GL20.GL_LINES, VertexAttributes.Usage.Position | VertexAttributes.Usage.ColorUnpacked, new Material()); builder.setColor(Color.RED); builder.line(0, 0, 0, 100, 0, 0); builder.setColor(Color.GREEN); builder.line(0, 0, 0, 0, 100, 0); builder.setColor(Color.BLUE); builder.line(0, 0, 0, 0, 0, 100); return modelBuilder.end(); }
From source file:com.momia.asg.screens.MainMenu.java
License:Apache License
public MainMenu(final ASG game) { this.game = game; batch = new SpriteBatch(); stage = new Stage(); Gdx.input.setInputProcessor(stage);/* w w w .java2s . co m*/ // A skin can be loaded via JSON or defined programmatically, either is fine. Using a skin is optional but strongly // recommended solely for the convenience of getting a texture, region, etc as a drawable, tinted drawable, etc. skin = new Skin(); // Generate a 1x1 white texture and store it in the skin named "white". Pixmap pixmap = new Pixmap(1, 1, Format.RGBA8888); pixmap.setColor(Color.WHITE); pixmap.fill(); skin.add("white", new Texture(pixmap)); // Store the default libgdx font under the name "default". skin.add("default", new BitmapFont()); // Configure a TextButtonStyle and name it "default". Skin resources are stored by type, so this doesn't overwrite the font. TextButtonStyle textButtonStyle = new TextButtonStyle(); textButtonStyle.up = skin.newDrawable("white", Color.DARK_GRAY); textButtonStyle.down = skin.newDrawable("white", Color.DARK_GRAY); textButtonStyle.checked = skin.newDrawable("white", Color.BLUE); textButtonStyle.over = skin.newDrawable("white", Color.LIGHT_GRAY); textButtonStyle.font = skin.getFont("default"); skin.add("default", textButtonStyle); // Create a table that fills the screen. Everything else will go inside this table. Table table = new Table(); table.setFillParent(true); stage.addActor(table); // Create a button with the "default" TextButtonStyle. A 3rd parameter can be used to specify a name other than "default". final TextButton button = new TextButton("New Game", skin); table.add(button); // Add a listener to the button. ChangeListener is fired when the button's checked state changes, eg when clicked, // Button#setChecked() is called, via a key press, etc. If the event.cancel() is called, the checked state will be reverted. // ClickListener could have been used, but would only fire when clicked. Also, canceling a ClickListener event won't // revert the checked state. button.addListener(new ClickListener() { public void clicked(InputEvent event, float x, float y) { if (button.isChecked()) game.setScreen(new Screen1(game)); } }); }