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:com.game.libgdx.roguelikeengine.PopupInfoText.java
License:Open Source License
public void drawScreen(SpriteBatch batch, BitmapFont font, String text, float fadein, int linedist, Color color, boolean resize) { float scaleX = font.getScaleX(); float scaleY = font.getScaleY(); update_x((int) (Gdx.graphics.getWidth() * 0.5f - this.width * 0.5f)); update_y((int) (Gdx.graphics.getHeight() * 0.5f - this.height * 0.5f)); mouseOverElement = ""; if (!lastMessage.equals(text) || resize) { this.clearRenderWords(); lineCount = 0;//from w w w. j a va 2s . co m int linepos = 0; int currentWidth = textoffsetx; int nextWidth = 0; int maxWidth = (int) (width - textoffsetx); String[] words = null; for (String line : text.split("\n")) { lineCount = lineCount + 1; currentWidth = textoffsetx; words = line.split(" "); for (String word : words) { if (word.contains("\t")) { word = word.replace("\t", " "); } Color wordColor = color; if (word.length() > 7) { String hex = word.substring(0, 7); if (Pattern.matches(colorPattern, hex)) { wordColor = this.hex2Rgb(hex); word = word.replace(hex, ""); } } nextWidth = (int) (currentWidth + font.getBounds(word + " ").width); if (nextWidth > maxWidth) { currentWidth = textoffsetx; nextWidth = (int) (currentWidth + font.getBounds(word + " ").width); linepos = linepos + 1; lineCount = lineCount + 1; } int wordx = currentWidth; int wordy = height - ((textoffsety) + (linepos * linedist)); this.addWordToRender(word, new WordRectangle(wordx, wordy, font.getBounds(word + " ").width, font.getLineHeight()) .withColor(wordColor)); currentWidth = nextWidth; } linepos++; currentWidth = x + textoffsetx; } } this.background.draw(batch, x, y, width, height); while (((lineCount * font.getLineHeight() + lineCount * linedist) * font.getScaleY()) > height - textoffsety) { font.setScale(font.getScaleY() - 0.1f); } if (font.getScaleY() != scaleY) { drawScreen(batch, font, text, fadein, linedist, color, true); font.setScale(scaleX, scaleY); return; } boolean anyClickable = false; Set<Entry<String, LinkedList<WordRectangle>>> keys = renderWords.entrySet(); for (Entry<String, LinkedList<WordRectangle>> entry : keys) { for (WordRectangle rect : entry.getValue()) { font.setColor(rect.color.r, rect.color.g, rect.color.b, fadein); if (wordClickListeners.containsKey(entry.getKey())) { if (mouseOverWord(rect, font)) { font.setColor(Color.BLUE.r, Color.BLUE.g, Color.BLUE.b, fadein); mouseOverElement = entry.getKey(); } else { font.setColor(Color.CYAN); font.setColor(Color.CYAN.r, Color.CYAN.g, Color.CYAN.b, fadein); } anyClickable = true; } font.draw(batch, entry.getKey().replace("_", " "), rect.x + x, rect.y + y); } } if (!anyClickable) { Color c = font.getColor(); font.setColor(instructionsColor.r, instructionsColor.g, instructionsColor.b, fadein); font.draw(batch, instructions, x + (width * 0.5f) - (font.getBounds(instructions).width * 0.5f), y + font.getBounds(instructions).height + Gdx.graphics.getHeight() * 0.05f); font.setColor(c); } lastMessage = text; font.setScale(scaleX, scaleY); }
From source file:com.github.mkjensen.breakall.actor.Ball.java
License:Apache License
@Override protected void draw(ShapeRenderer renderer) { renderer.begin(ShapeType.Filled);//from w ww .ja v a 2 s.c o m renderer.setColor(Color.BLUE); renderer.circle(getX(), getY(), getRadius(), CIRCLE_SEGMENTS); renderer.end(); }
From source file:com.jmstudios.pointandhit.TargetManager.java
License:Open Source License
public void spawnTarget() { // Temp difficulty float lifeTime = (float) (targetLifeTime * (1.0f - (float) ((Math.pow(score, (double) (1.0 / 3.0)) / 20.0)))); target.reinnitialize(lifeTime, targetRadius, randomSpawnLocation(), Color.BLUE); }
From source file:com.johnogel.astrobros.levels.LevelTwo.java
@Override public void initialize() { this.initializeWorld(); width = mngr.getWidth();/*from w ww .jav a 2s.c om*/ height = mngr.getHeight(); //this.ray_handler.dispose(); this.ray_handler = mngr.getRayHandler(); this.world = mngr.getWorld(); this.camera = mngr.getCamera(); //this.free_bros.add(new Player(world, camera, 220)); //this.free_bros.add(new Player(world, camera, 200)); this.free_bros.add(new Player(world, camera, 170)); this.free_bros.add(new Player(world, camera, 150)); this.free_bros.add(new Player(world, camera, 200)); //this.free_bros.add(new Player(world, camera, 80)); //world.createJoint(joint_def); initializePlayer(); initializeArrays(); initializeContactListener(); //adds sun to suns array without storing locally new Sun(this, suns, 8000, Color.BLUE, 1000, width / 2, height / 2); suns.get(0).initializeTexture(texture_handler, TextureHandler.SUN); this.setOrbits(); this.initializeBoundaries(); this.initializeBackground(); this.initializeLocators(); }
From source file:com.johnogel.astrobros.managers.MenuManager.java
@Override public void initialize() { mngr.initializeWorld();// w w w .java2s . c om this.ray_handler = mngr.getRayHandler(); this.camera = mngr.getCamera(); if (press_space != null) { dispose(); } press_space = new Texture(Gdx.files.internal("PressSpace.png")); title = new Texture(Gdx.files.internal("AstroBros.png")); blue_bar = new Texture(Gdx.files.internal("blue-bar.png")); container = new Texture(Gdx.files.internal("load-container.png")); new PointLight(ray_handler, 200, Color.BLUE, 600, 0, 300); new PointLight(ray_handler, 200, Color.BLUE, 600, 0, -300); ray_handler.setCombinedMatrix(camera); music.setSong(SoundPlayer.TITLE_SONG); music.setLooping(true); music.playSong(); initialized = false; }
From source file:com.johnogel.astrobros.managers.OpeningManager.java
@Override public void initialize() { mngr.initializeWorld();/*w ww .j a v a 2 s.c om*/ this.ray_handler = mngr.getRayHandler(); this.camera = mngr.getCamera(); /*press_space = new Texture(Gdx.files.internal("PressSpace.png")); instructions = new Texture(Gdx.files.internal("AstroBros.png")); blue_bar = new Texture(Gdx.files.internal("blue-bar.png")); container = new Texture(Gdx.files.internal("load-container.png"));*/ textures.add(new Texture(Gdx.files.internal("credit.png"))); textures.add(new Texture(Gdx.files.internal("libgdx.png"))); textures.add(new Texture(Gdx.files.internal("instructions.png"))); new PointLight(ray_handler, 200, Color.BLUE, 600, 0, 300); new PointLight(ray_handler, 200, Color.BLUE, 600, 0, -300); ray_handler.setCombinedMatrix(camera); }
From source file:com.johnogel.astrobros.managers.screens.GameEndScreen.java
@Override public void initialize() { initializeWorld();/*from w w w . j av a 2s.c o m*/ updateReferences(); String s = "" + mngr.getTotalScore(); String t = "" + mngr.getTopScore(); score = s + " OUT OF " + t; System.out.println("score: " + s); layout_middle = new GlyphLayout(font, score); new PointLight(ray_handler, 5000, Color.BLUE, 500, camera.viewportWidth / 2, -300); new PointLight(ray_handler, 5000, Color.BLUE, 500, camera.viewportWidth / 2, 300); new PointLight(ray_handler, 5000, Color.WHITE, 500, -camera.viewportWidth / 2, -300); new PointLight(ray_handler, 5000, Color.BLUE, 500, -camera.viewportWidth / 2, 300); }
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 w w w. ja v a 2s . c o 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.mbrlabs.mundus.utils.Compass.java
License:Apache License
public Compass(PerspectiveCamera worldCam) { this.worldCam = worldCam; this.ownCam = new PerspectiveCamera(); ModelBuilder modelBuilder = new ModelBuilder(); modelBuilder.begin();/* ww w. j av a 2 s .c o m*/ MeshPartBuilder builder = modelBuilder.part("compass", GL20.GL_TRIANGLES, VertexAttributes.Usage.Position | VertexAttributes.Usage.ColorUnpacked, new Material()); builder.setColor(Color.RED); builder.arrow(0, 0, 0, ARROW_LENGTH, 0, 0, ARROW_CAP_SIZE, ARROW_THIKNESS, ARROW_DIVISIONS); builder.setColor(Color.GREEN); builder.arrow(0, 0, 0, 0, ARROW_LENGTH, 0, ARROW_CAP_SIZE, ARROW_THIKNESS, ARROW_DIVISIONS); builder.setColor(Color.BLUE); builder.arrow(0, 0, 0, 0, 0, ARROW_LENGTH, ARROW_CAP_SIZE, ARROW_THIKNESS, ARROW_DIVISIONS); compassModel = modelBuilder.end(); compassInstance = new ModelInstance(compassModel); // translate to top left corner compassInstance.transform.translate(0.93f, 0.94f, 0); }
From source file:com.minekrash.game.Menu.java
public void render(SpriteBatch g) { if (isInitMenu) { paint.drawBackground(g, cover, alphaMenu); paint.drawImage(g, marco, -(marco.getWidth() / 2), -(marco.getHeight() / 2)); sLogo.setAlpha(alphaMenu);//from w ww. j av a2 s .c o m sLogo.draw(g); paint.drawImage(g, humoMenu, -(WIDTH / 2) - humoX, -(HEIGHT / 2)); paint.drawImage(g, humoMenu, (WIDTH / 2) - humoX, -(HEIGHT / 2)); paint.drawText(g, fuente, //Tipo de fuente Define.RECORD[Define.Lenguaje] + (int) maxMetros + Define.LOGRO_2[Define.Lenguaje], //Texto a mostrar Color.BLUE, //Color 0, //Posicin X fuenteGrande.getCapHeight() - (fuenteGrande.getCapHeight() / 4), //Posicin Y BitmapFont.HAlignment.CENTER, //Alineacin. Se centrar en X alphaMenu); //Transparencia } }