List of usage examples for com.badlogic.gdx.graphics Color BLUE
Color BLUE
To view the source code for com.badlogic.gdx.graphics Color BLUE.
Click Source Link
From source file:ch.coldpixel.game.MapDrawing.java
public void background() { shape.begin(ShapeRenderer.ShapeType.Filled); shape.rect(0, 0, LEVEL_1_WIDTH, LEVEL_1_HEIGTH, Color.BLUE, Color.BLUE, Color.ORANGE, Color.ORANGE); shape.setColor(Color.YELLOW); shape.circle(100, WINDOW_HEIGTH - 100, 50, 5); shape.end();/*from ww w . ja v a 2s . c o m*/ }
From source file:ch.p1gu.game.systeme.affichage.DessinerHUD.java
@Override protected void processSystem() { Entity superLama = world.getManager(TagManager.class).getEntity("SuperLama"); Vie vie = mapperVie.get(superLama);//from w w w .j a va 2s . c o m Bouclier bouclier = mapperBou.get(superLama); for (int i = 0; i < vie.vie; i++) { rendererFilled.setColor(Color.RED); rendererFilled.circle(10 + ((i * 12)), 7, 5); } rendererFilled.setColor(Color.BLUE); rendererFilled.rect(5, 17, bouclier.energie * 1, 10); }
From source file:com.badlogic.gdx.tests.dragome.examples.GearsDemo.java
@Override public void create() { environment = new Environment(); environment.set(new ColorAttribute(ColorAttribute.AmbientLight, .2f, .2f, .2f, 2f)); // environment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, 0f, -0.5f, -0.5f)); sl = new PointLight().setPosition(-5, 10, -6).setColor(1, 1, 1, 1).setIntensity(150); // sl2 = new PointLight().setPosition(0, 7, 5).setColor(0.3f, 0.8f, 0.3f, 1) // .setIntensity(20); //// www . ja va 2 s .c om // sl3 = new PointLight().setPosition(0, 9, 6).setColor(0.3f, 0.3f, 0.8f, 1) // .setIntensity(20); environment.add(sl); // environment.add(sl2); // environment.add(sl3); cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); cam.position.set(-10, 3, 10f); cam.lookAt(-3, 0, 0); cam.near = 1f; cam.far = 100f; cam.update(); cameraController = new CameraInputController(cam); cameraController.autoUpdate = false; cameraController.forwardTarget = false; cameraController.translateTarget = false; Gdx.input.setInputProcessor(new InputMultiplexer(cameraController)); time = TimeUtils.millis(); viewport = new ScreenViewport(cam); guiViewport = new ScreenViewport(); DefaultShaderProvider defaultShaderProvider = new DefaultShaderProvider(); modelBatch = new ModelBatch(defaultShaderProvider); ModelBuilder modelBuilder = new ModelBuilder(); model1 = gear(modelBuilder, 1.0f, 4.0f, 1.0f, 20, 0.7f, Color.RED); gear1 = new ModelInstance(model1); model2 = gear(modelBuilder, 0.5f, 2.0f, 2.0f, 10, 0.7f, Color.GREEN); gear2 = new ModelInstance(model2); model3 = gear(modelBuilder, 1.3f, 2.0f, 1.5f, 10, 0.7f, Color.BLUE); gear3 = new ModelInstance(model3); font = new BitmapFont(); batch = new SpriteBatch(); lightModel = modelBuilder.createSphere(1, 1, 1, 10, 10, new Material(ColorAttribute.createDiffuse(1, 1, 1, 1)), Usage.Position); lightModel.nodes.get(0).parts.get(0).setRenderable(pLight = new Renderable()); }
From source file:com.badlydrawngames.general.SimpleButton.java
License:Apache License
public void draw(SpriteBatch spriteBatch) { Color oldColor = font.getColor(); if (down) {// ww w . j a va 2 s . c o m spriteBatch.setColor(Color.RED); } else { spriteBatch.setColor(Color.BLUE); } spriteBatch.draw(Assets.pureWhiteTextureRegion, x, y, w, h); spriteBatch.setColor(Color.WHITE); if (down) { font.setColor(oldColor.r / 2, oldColor.g / 2, oldColor.b / 2, oldColor.a); } float textX = x; float textY = y + h; textY -= (h - textHeight) / 2; font.drawWrapped(spriteBatch, text, textX, textY, w, alignment); font.setColor(oldColor); }
From source file:com.badlydrawngames.veryangryrobots.WorldView.java
License:Apache License
private int createWallsAndDoors(SpriteCache sc) { // Walls and doors never move, so we put them into a sprite cache. sc.clear();//from w w w . j av a2 s.com sc.beginCache(); sc.setColor(Color.BLUE); Array<Rectangle> rects = world.getWallRects(); for (int i = 0; i < rects.size; i++) { Rectangle rect = rects.get(i); sc.add(Assets.pureWhiteTextureRegion, rect.x, rect.y, rect.width, rect.height); } sc.setColor(1, 1, 0, 1); rects = world.getDoorRects(); for (int i = 0; i < rects.size; i++) { Rectangle rect = rects.get(i); sc.add(Assets.pureWhiteTextureRegion, rect.x, rect.y, rect.width, rect.height); } return sc.endCache(); }
From source file:com.bladecoder.engine.util.Utils3D.java
License:Apache License
private static void createAxes() { ModelBuilder modelBuilder = new ModelBuilder(); modelBuilder.begin();// w ww . j a v a 2 s . c o m MeshPartBuilder builder = modelBuilder.part("grid", GL20.GL_LINES, Usage.Position | 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, Usage.Position | Usage.ColorUnpacked, new Material()); builder.setColor(Color.RED); builder.line(0, 0, 0, 10, 0, 0); builder.setColor(Color.GREEN); builder.line(0, 0, 0, 0, 10, 0); builder.setColor(Color.BLUE); builder.line(0, 0, 0, 0, 0, 10); axesModel = modelBuilder.end(); axesInstance = new ModelInstance(axesModel); }
From source file:com.evoluzion.Pantalla.java
License:Open Source License
@Override public void render(float delta) { //Game loop/*from ww w .jav a 2 s. com*/ Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); camara.update(); stage.act(delta); if (verBotones1 == 1) { b_colectar.setVisible(false); b_colectarP.setVisible(false); b_colectarPM.setVisible(false); b_colectarPnM.setVisible(false); verBotones1 = verBotones1 * 2; } if (verBotones1 == -1) { b_colectar.setVisible(true); b_colectarP.setVisible(true); b_colectarPM.setVisible(true); b_colectarPnM.setVisible(true); verBotones1 = verBotones1 * 2; } if (m.pausaGame == 1) { //1=play -1=pausa m.update();//actualiza los datos que maneja el Mundo // System.out.println("rendering"); } batch.setProjectionMatrix(camara.combined); //comienzo a graficar // //dibuja Senergia if (cb_verEnergia.isChecked() == true) { cantidad = m.ase.size; for (cont = cantidad - 1; cont >= 0; cont--) { se = m.ase.get(cont); se.verObjeto(batch); } } //dibujamos Qenergia if (cb_verMasa.isChecked() == true) { cantidad2 = m.aqe.size; for (cont2 = cantidad2 - 1; cont2 >= 0; cont2--) { qe = m.aqe.get(cont2); qe.verObjeto(batch); } } // for(Qenergia qe :m.aqe){qe.verObjeto(batch);} //dibujamos los organismos if (cb_verOrganismos.isChecked() == true) { cantidad3 = m.aorg.size; for (cont3 = cantidad3 - 1; cont3 >= 0; cont3--) { or = m.aorg.get(cont3); or.verOrganismo(batch); } // verl los organismos marcados cantidad3 = m.aorg.size; for (cont3 = cantidad3 - 1; cont3 >= 0; cont3--) { or = m.aorg.get(cont3); or.verMarcado(borde, batch, fuente); } } //dibujar rectangulos en modo debug if (debugin == true) { for (Organismo or : m.aorg) { or.verBorde(borde); } //for(Senergia se: m.ase){ se.verBorde(borde);} for (Qenergia qe : m.aqe) { qe.verBorde(borde); } } caja.begin(ShapeType.FilledRectangle); caja.setColor(Color.BLACK); caja.filledRect(0, m.alto - 30, m.ancho, 30); caja.end(); batch.begin(); fuente.draw(batch, "d: " + m.dias + " |h: " + m.horas + " |m: " + m.minutos + " |s: " + m.segundos, 400, m.alto - 30); batch.end(); if (verPanel == 1) { caja.begin(ShapeType.FilledRectangle); caja.setColor(Color.BLUE); caja.filledRect(0, m.alto - 400, 170, 400); caja.end(); batch.begin(); fuente.setColor(Color.WHITE); fuente.draw(batch, tx.Organismos + m.aorg.size, 5, m.alto - 30); fuente.draw(batch, tx.mutantes + m.aEspesies.size, 5, m.alto - 50); int masatotal = (int) (m.BiomasaTotal() + m.MateriaLibre()); fuente.draw(batch, tx.masaTotal + masatotal, 5, m.alto - 70); fuente.draw(batch, tx.masa + m.MateriaLibre(), 5, m.alto - 90); fuente.draw(batch, tx.biomasa + m.BiomasaTotal(), 5, m.alto - 110); fuente.draw(batch, tx.velocidadMedia + format.format(m.velocidadMedia()), 5, m.alto - 130); fuente.draw(batch, tx.tamanoMedi + format.format(m.tamanoMedio()), 5, m.alto - 150); fuente.draw(batch, tx.tasaMutacionMedia + m.tasaMutMedio(), 5, m.alto - 170); fuente.draw(batch, tx.vidaMdia + format.format(m.longevidadMedio()) + " (s)", 5, m.alto - 190); fuente.draw(batch, tx.resistensiaATB + m.cantidadResistentes(), 5, m.alto - 210); fuente.draw(batch, tx.temperatura + format.format(m.temperatura), 5, m.alto - 230); fuente.draw(batch, tx.temOptimaMedia + format.format(m.temOptimaMedia()), 5, m.alto - 250); if (m.antibiotico == 1) { fuente.draw(batch, tx.antibioticoON, 5, m.alto - 370); } else { fuente.draw(batch, tx.antibioticoOFF, 5, m.alto - 370); } ; batch.end(); cb_verEnergia.setVisible(true); cb_verMasa.setVisible(true); cb_verOrganismos.setVisible(true); } if (verPanel == -1) { cb_verEnergia.setVisible(false); cb_verMasa.setVisible(false); cb_verOrganismos.setVisible(false); } //botones batch.begin(); stage.draw(); batch.end(); if (Gdx.input.justTouched()) { Vector3 touchPos = new Vector3(); touchPos.set(Gdx.input.getX(), Gdx.input.getY(), 0); camara.unproject(touchPos); // System.out.println(touchPos.x + " "+ touchPos.y); cantidad3 = m.aorg.size; for (cont3 = cantidad3 - 1; cont3 >= 0; cont3--) { or = m.aorg.get(cont3); if (touchPos.x > or.posicion.x && touchPos.x < or.posicion.x + or.ancho && touchPos.y > or.posicion.y && touchPos.y < or.posicion.y + or.alto) { or.marcado = or.marcado * (-1); } } } if (Gdx.input.isButtonPressed(Input.Buttons.LEFT)) { Vector3 touchPos = new Vector3(); touchPos.set(Gdx.input.getX(), Gdx.input.getY(), 0); camara.unproject(touchPos); cantidad3 = m.aorg.size; for (cont3 = cantidad3 - 1; cont3 >= 0; cont3--) { or = m.aorg.get(cont3); if (or.marcado == -1 && touchPos.x > or.posicion.x - or.ancho && touchPos.x < or.posicion.x + or.ancho * 2 && touchPos.y > or.posicion.y - or.alto && touchPos.y < or.posicion.y + or.alto * 2) { or.posicion.x = touchPos.x - or.ancho / 2; or.posicion.y = touchPos.y - or.alto / 2; or.update(); } } } }
From source file:com.finalproject.MainGame.EndScreen.java
public void create() { batch = new SpriteBatch(); stage = new Stage(); Gdx.input.setInputProcessor(stage);//from w ww .j a va2 s . c om 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 Loose label skin.add("default", textButtonStyle); skin.add("default", textLabelStyle); // Add the end screen label final Label title = new Label(" Y o u L o s e ! ", textLabelStyle); title.setPosition(265, 300); stage.addActor(title); }
From source file:com.finalproject.MainGame.MenuScreen.java
public void create() { // play the start screen sound AssetManager.splash.play();//from w w w . ja v a 2s . 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 . jav 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); }