List of usage examples for com.badlogic.gdx.graphics Color MAGENTA
Color MAGENTA
To view the source code for com.badlogic.gdx.graphics Color MAGENTA.
Click Source Link
From source file:net.k3rnel.unsealed.battle.magic.TranquilDart.java
License:Open Source License
/** * 0 = gray. 1 = blue. 2 = red. 3 = green. * @param color// www.j a v a 2 s . c om */ public TranquilDart(TextureAtlas atlas, int color, float speed, BattleEntity entity) { super(speed, 0, entity); AtlasRegion atlasRegion = atlas.findRegion("battle/entities/fireball"); TextureRegion[][] spriteSheet = atlasRegion.split(34, 25); TextureRegion[] frames = new TextureRegion[3]; frames[0] = spriteSheet[color][0]; frames[1] = spriteSheet[color][1]; frames[2] = spriteSheet[color][2]; Animation attacking = new Animation(0.1f, frames); attacking.setPlayMode(Animation.LOOP); this.animations.put("attacking", attacking); this.setState(BattleEntity.stateAttacking); this.setHeight(30); this.setWidth(30); offsetX = (int) entity.getWidth() - 120; offsetY = 0; this.addAction(color(Color.MAGENTA)); this.setGrid(entity.getGridXInt() - 1, entity.getGridYInt()); }
From source file:non.plugins.graphics.java
public Color color(String name) { if (name.startsWith("#")) return Color.valueOf(name.replace("#", "")); if ("clear".equalsIgnoreCase(name)) return Color.CLEAR; else if ("white".equalsIgnoreCase(name)) return Color.WHITE; else if ("black".equalsIgnoreCase(name)) return Color.BLACK; else if ("red".equalsIgnoreCase(name)) return Color.RED; else if ("green".equalsIgnoreCase(name)) return Color.GREEN; else if ("blue".equalsIgnoreCase(name)) return Color.BLUE; else if ("lightgray".equalsIgnoreCase(name)) return Color.LIGHT_GRAY; else if ("gray".equalsIgnoreCase(name)) return Color.GRAY; else if ("darkgray".equalsIgnoreCase(name)) return Color.DARK_GRAY; else if ("pink".equalsIgnoreCase(name)) return Color.PINK; else if ("orange".equalsIgnoreCase(name)) return Color.ORANGE; else if ("yellow".equalsIgnoreCase(name)) return Color.YELLOW; else if ("magenta".equalsIgnoreCase(name)) return Color.MAGENTA; else if ("cyan".equalsIgnoreCase(name)) return Color.CYAN; else if ("olive".equalsIgnoreCase(name)) return Color.OLIVE; else if ("purple".equalsIgnoreCase(name)) return Color.PURPLE; else if ("maroon".equalsIgnoreCase(name)) return Color.MAROON; else if ("teal".equalsIgnoreCase(name)) return Color.TEAL; else if ("navy".equalsIgnoreCase(name)) return Color.NAVY; return Color.CLEAR; }
From source file:org.catrobat.catroid.stage.StageListener.java
License:Open Source License
@Override public void create() { font = new BitmapFont(); font.setColor(1f, 0f, 0.05f, 1f);/*www . j a v a 2s .co m*/ font.getData().setScale(1.2f); deltaActionTimeDivisor = 10f; shapeRenderer = new ShapeRenderer(); project = ProjectManager.getInstance().getCurrentProject(); scene = ProjectManager.getInstance().getSceneToPlay(); pathForSceneScreenshot = Utils.buildScenePath(project.getName(), scene.getName()) + "/"; virtualWidth = project.getXmlHeader().virtualScreenWidth; virtualHeight = project.getXmlHeader().virtualScreenHeight; virtualWidthHalf = virtualWidth / 2; virtualHeightHalf = virtualHeight / 2; camera = new OrthographicCamera(); viewPort = new ExtendViewport(virtualWidth, virtualHeight, camera); if (batch == null) { batch = new SpriteBatch(); } else { batch = new SpriteBatch(1000, batch.getShader()); } stage = new Stage(viewPort, batch); initScreenMode(); initStageInputListener(); physicsWorld = scene.resetPhysicsWorld(); clonedSprites = new HashSet<>(); sprites = new ArrayList<>(scene.getSpriteList()); boolean addPenActor = true; for (Sprite sprite : sprites) { sprite.resetSprite(); sprite.look.createBrightnessContrastHueShader(); stage.addActor(sprite.look); if (addPenActor) { penActor = new PenActor(); stage.addActor(penActor); addPenActor = false; } } passepartout = new Passepartout(ScreenValues.SCREEN_WIDTH, ScreenValues.SCREEN_HEIGHT, maximizeViewPortWidth, maximizeViewPortHeight, virtualWidth, virtualHeight); stage.addActor(passepartout); if (DEBUG) { OrthoCamController camController = new OrthoCamController(camera); InputMultiplexer multiplexer = new InputMultiplexer(); multiplexer.addProcessor(camController); multiplexer.addProcessor(stage); Gdx.input.setInputProcessor(multiplexer); fpsLogger = new FPSLogger(); } else { Gdx.input.setInputProcessor(stage); } axes = new Texture(Gdx.files.internal("stage/red_pixel.bmp")); skipFirstFrameForAutomaticScreenshot = true; if (checkIfAutomaticScreenshotShouldBeTaken) { makeAutomaticScreenshot = project.manualScreenshotExists(SCREENSHOT_MANUAL_FILE_NAME) || scene.screenshotExists(SCREENSHOT_AUTOMATIC_FILE_NAME) || scene.screenshotExists(SCREENSHOT_MANUAL_FILE_NAME); } if (drawDebugCollisionPolygons) { collisionPolygonDebugRenderer.setProjectionMatrix(camera.combined); collisionPolygonDebugRenderer.setAutoShapeType(true); collisionPolygonDebugRenderer.setColor(Color.MAGENTA); } }
From source file:org.catrobat.catroid.stage.StageListener.java
License:Open Source License
public void drawDebugCollisionPolygons() { boolean drawPolygons = true; boolean drawBoundingBoxes = false; boolean drawPolygonPoints = false; boolean drawTouchingAreas = true; Color colorPolygons = Color.MAGENTA; Color colorBoundingBoxes = Color.MAROON; Color colorPolygonPoints = Color.BLACK; Color colorTouchingAreas = Color.RED; int lineWidth = 5; Gdx.gl20.glLineWidth(lineWidth / camera.zoom); collisionPolygonDebugRenderer.setAutoShapeType(true); collisionPolygonDebugRenderer.begin(); for (Sprite sprite : sprites.subList(1, sprites.size())) { Polygon[] polygonsForSprite = sprite.look.getCurrentCollisionPolygon(); if (polygonsForSprite != null) { for (Polygon polygonToDraw : polygonsForSprite) { if (drawPolygons) { collisionPolygonDebugRenderer.setColor(colorPolygons); collisionPolygonDebugRenderer.polygon(polygonToDraw.getTransformedVertices()); }//from ww w .ja v a 2s . c om if (drawBoundingBoxes) { Rectangle r = polygonToDraw.getBoundingRectangle(); collisionPolygonDebugRenderer.setColor(colorBoundingBoxes); collisionPolygonDebugRenderer.rect(r.getX(), r.getY(), r.getWidth(), r.getHeight(), Color.CYAN, Color.CYAN, Color.CYAN, Color.CYAN); } if (drawPolygonPoints) { collisionPolygonDebugRenderer.setColor(colorPolygonPoints); float[] points = polygonToDraw.getTransformedVertices(); for (int i = 0; i < points.length; i += 2) { collisionPolygonDebugRenderer.circle(points[i], points[i + 1], 10); } } } if (drawTouchingAreas) { ArrayList<PointF> touchingPoints = TouchUtil.getCurrentTouchingPoints(); collisionPolygonDebugRenderer.setColor(colorTouchingAreas); for (PointF point : touchingPoints) { collisionPolygonDebugRenderer.circle(point.x, point.y, Constants.COLLISION_WITH_FINGER_TOUCH_RADIUS); } } } } collisionPolygonDebugRenderer.end(); }
From source file:spaceisnear.game.ui.console.InGameLog.java
private static Color getColorOfLevel(LogString str) { LogLevel level = str.getLevel();//from w w w . ja v a 2 s. c o m switch (level) { case DEBUG: return Color.GRAY; case TALKING: return Color.BLACK; case BROADCASTING: return new Color(0, 0.5f, 0, 1); case WARNING: return Color.RED; case OOC: return Color.BLUE; case PRIVATE: return Color.MAGENTA; default: return Color.GRAY; } }
From source file:tilo.modules.graphics.java
License:Open Source License
public Color color(String name) { if (name.startsWith("#")) return Color.valueOf(name.replace("#", "")); if ("clear".equalsIgnoreCase(name)) return Color.CLEAR; else if ("white".equalsIgnoreCase(name)) return Color.WHITE; else if ("black".equalsIgnoreCase(name)) return Color.BLACK; else if ("red".equalsIgnoreCase(name)) return Color.RED; else if ("green".equalsIgnoreCase(name)) return Color.GREEN; else if ("blue".equalsIgnoreCase(name)) return Color.BLUE; else if ("lightgray".equalsIgnoreCase(name)) return Color.LIGHT_GRAY; else if ("gray".equalsIgnoreCase(name)) return Color.GRAY; else if ("darkgray".equalsIgnoreCase(name)) return Color.DARK_GRAY; else if ("pink".equalsIgnoreCase(name)) return Color.PINK; else if ("orange".equalsIgnoreCase(name)) return Color.ORANGE; else if ("yellow".equalsIgnoreCase(name)) return Color.YELLOW; else if ("magenta".equalsIgnoreCase(name)) return Color.MAGENTA; else if ("cyan".equalsIgnoreCase(name)) return Color.CYAN; return Color.CLEAR; }
From source file:vault.clockwork.actors.ButtonActor.java
License:Open Source License
@Override public void debug(ShapeRenderer gizmo) { Rectangle rect = spr.getBoundingRectangle(); gizmo.setColor(Color.MAGENTA); gizmo.begin(ShapeRenderer.ShapeType.Line); gizmo.rect(rect.x, rect.y, rect.width, rect.height); gizmo.end();//from w w w. j a va 2 s. c o m }