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:broken.shotgun.throwthemoon.actors.Boss.java
License:Open Source License
@Override public void drawDebug(ShapeRenderer shapes) { if (!getDebug()) return;//from w w w .j av a 2 s . c om shapes.set(ShapeRenderer.ShapeType.Line); shapes.setColor(Color.GRAY); shapes.rect(getX(), getY(), getWidth(), getHeight()); shapes.setColor(Color.GREEN); shapes.rect(collisionArea.x, collisionArea.y, collisionArea.width, collisionArea.height); shapes.setColor(Color.RED); shapes.circle(getX() + getOriginX(), getY() + getOriginY(), 10f); }
From source file:broken.shotgun.throwthemoon.actors.Enemy.java
License:Open Source License
@Override public void drawDebug(ShapeRenderer shapes) { if (!getDebug()) return;//from ww w .j a v a 2 s . com shapes.set(ShapeRenderer.ShapeType.Line); shapes.setColor(Color.GRAY); shapes.rect(getX(), getY(), getWidth(), getHeight()); shapes.setColor(Color.GREEN); shapes.rect(collisionArea.x, collisionArea.y, collisionArea.width, collisionArea.height); }
From source file:broken.shotgun.throwthemoon.actors.Moon.java
License:Open Source License
@Override public void drawDebug(ShapeRenderer shapes) { super.drawDebug(shapes); if (!getDebug()) return;//from w w w .j a va 2 s. com shapes.setColor(Color.GRAY); shapes.rect(getX(), getY(), getWidth(), getHeight()); shapes.setColor(Color.RED); shapes.circle(getX() + getOriginX(), getY() + getOriginY(), 10f); }
From source file:broken.shotgun.throwthemoon.actors.MoonChain.java
License:Open Source License
public void animatePull() { addAction(sequence(color(Color.GRAY, 0.10f), color(Color.WHITE, 0.10f))); float volume = 1f; // [0.0, 1.0] float pitch = 1f; // [0.5. 2.0] float pan = 0f; // [-1, 1] chainPullSfx.play(volume, pitch, pan); }
From source file:broken.shotgun.throwthemoon.actors.MoonChain.java
License:Open Source License
public void hintPullChain() { addAction(sequence(color(Color.GRAY, 0.40f), color(Color.WHITE, 0.40f), color(Color.GRAY, 0.40f), color(Color.WHITE, 0.40f), color(Color.GRAY, 0.40f), color(Color.WHITE, 0.40f))); }
From source file:broken.shotgun.throwthemoon.actors.MoonChain.java
License:Open Source License
public void hintPullChainForever() { if (hinting)// w w w. j a v a 2 s. c om return; hinting = true; addAction(forever(sequence(color(Color.GRAY, 0.40f), color(Color.WHITE, 0.40f)))); }
From source file:broken.shotgun.throwthemoon.actors.Player.java
License:Open Source License
@Override public void drawDebug(ShapeRenderer shapes) { if (!getDebug()) return;/* w ww . ja v a 2 s.c o m*/ shapes.set(ShapeRenderer.ShapeType.Line); shapes.setColor(Color.GRAY); shapes.rect(getX(), getY(), getWidth(), getHeight()); shapes.setColor(Color.GREEN); shapes.rect(collisionArea.x, collisionArea.y, collisionArea.width, collisionArea.height); shapes.setColor(Color.RED); shapes.rect(attackArea.x, attackArea.y, attackArea.width, attackArea.height); shapes.setColor(Color.RED); shapes.circle(getX() + getOriginX(), getY() + getOriginY(), 10f); }
From source file:CB_UI.GL_UI.Views.MapView.java
License:Open Source License
public MapView(CB_RectF rec, MapMode Mode, String Name) { super(rec, Name); // statischen that nur setzen wenn die HauptMapView initialisiert wird if (Mode == MapMode.Normal) { that = this; } else {//from w w w .j a v a 2 s. c om this.setOnDoubleClickListener(new OnClickListener() { @Override public boolean onClick(GL_View_Base v, int x, int y, int pointer, int button) { // Center own position! setCenter(Locator.getCoordinate()); return true; } }); } this.Mode = Mode; Config.MapsforgeDayTheme.addChangedEventListener(themeChangedEventHandler); Config.MapsforgeNightTheme.addChangedEventListener(themeChangedEventHandler); registerSkinChangedEvent(); setBackground(Sprites.ListBack); int maxNumTiles = 0; // calculate max Map Tile cache try { int aTile = 256 * 256; maxTilesPerScreen = (int) ((rec.getWidth() * rec.getHeight()) / aTile + 0.5); maxNumTiles = (int) (maxTilesPerScreen * 6);// 6 times as much as necessary } catch (Exception e) { maxNumTiles = 60; } maxNumTiles = Math.min(maxNumTiles, 60); maxNumTiles = Math.max(maxNumTiles, 20); mapTileLoader.setMaxNumTiles(maxNumTiles); mapScale = new MapScale(new CB_RectF(GL_UISizes.margin, GL_UISizes.margin, this.getHalfWidth(), GL_UISizes.ZoomBtn.getHalfWidth() / 4), "mapScale", this, Config.ImperialUnits.getValue()); if (Mode == MapMode.Normal) { this.addChild(mapScale); } else { mapScale.setInvisible(); } // initial Zoom Buttons zoomBtn = new ZoomButtons(GL_UISizes.ZoomBtn, this, "ZoomButtons"); zoomBtn.setX(this.getWidth() - (zoomBtn.getWidth() + UI_Size_Base.that.getMargin())); zoomBtn.setOnClickListenerDown(new OnClickListener() { @Override public boolean onClick(GL_View_Base v, int x, int y, int pointer, int button) { // bei einer Zoom Animation in negativer Richtung muss der setDiffCameraZoom gesetzt werden! // zoomScale.setDiffCameraZoom(-1.9f, true); // zoomScale.setZoom(zoomBtn.getZoom()); zoomScale.resetFadeOut(); inputState = InputState.Idle; lastDynamicZoom = zoomBtn.getZoom(); kineticZoom = new KineticZoom(camera.zoom, MapTileLoader.getMapTilePosFactor(zoomBtn.getZoom()), System.currentTimeMillis(), System.currentTimeMillis() + ZoomTime); GL.that.addRenderView(MapView.this, GL.FRAME_RATE_ACTION); GL.that.renderOnce(); calcPixelsPerMeter(); return true; } }); zoomBtn.setOnClickListenerUp(new OnClickListener() { @Override public boolean onClick(GL_View_Base v, int x, int y, int pointer, int button) { setZoomScale(zoomBtn.getZoom()); zoomScale.resetFadeOut(); inputState = InputState.Idle; lastDynamicZoom = zoomBtn.getZoom(); kineticZoom = new KineticZoom(camera.zoom, MapTileLoader.getMapTilePosFactor(zoomBtn.getZoom()), System.currentTimeMillis(), System.currentTimeMillis() + ZoomTime); GL.that.addRenderView(MapView.this, GL.FRAME_RATE_ACTION); GL.that.renderOnce(); calcPixelsPerMeter(); return true; } }); if (Mode == MapMode.Compass) { zoomBtn.setInvisible(); } else { this.addChild(zoomBtn); zoomBtn.setMinimumFadeValue(0.25f); } this.setOnClickListener(onClickListener); float InfoHeight = 0; if (Mode == MapMode.Normal) { info = (MapInfoPanel) this.addChild(new MapInfoPanel(GL_UISizes.Info, "InfoPanel", this)); InfoHeight = info.getHeight(); } CB_RectF ZoomScaleRec = new CB_RectF(); ZoomScaleRec.setSize((float) (44.6666667 * GL_UISizes.DPI), this.getHeight() - InfoHeight - (GL_UISizes.margin * 4) - zoomBtn.getMaxY()); ZoomScaleRec.setPos(new Vector2(GL_UISizes.margin, zoomBtn.getMaxY() + GL_UISizes.margin)); zoomScale = new ZoomScale(ZoomScaleRec, "zoomScale", 2, 21, 12); if (Mode == MapMode.Normal) this.addChild(zoomScale); mapIntWidth = (int) rec.getWidth(); mapIntHeight = (int) rec.getHeight(); drawingWidth = mapIntWidth; drawingHeight = mapIntHeight; InitializeMap(); // initial Zoom Scale // zoomScale = new GL_ZoomScale(6, 20, 13); mapCacheList = new MapViewCacheList(MapTileLoader.MAX_MAP_ZOOM); // from create String[] currentLayerNames = Config.CurrentMapLayer.getValue(); if (ManagerBase.Manager != null) { if (mapTileLoader.getCurrentLayer() == null) { mapTileLoader.setCurrentLayer( ManagerBase.Manager.getOrAddLayer(currentLayerNames, currentLayerNames[0], "")); } } String[] currentOverlayLayerName = new String[] { Config.CurrentMapOverlayLayer.getValue() }; if (ManagerBase.Manager != null) { if (mapTileLoader.getCurrentOverlayLayer() == null && currentOverlayLayerName[0].length() > 0) mapTileLoader.setCurrentOverlayLayer( ManagerBase.Manager.getOrAddLayer(currentOverlayLayerName, currentOverlayLayerName[0], "")); } iconFactor = Config.MapViewDPIFaktor.getValue(); liveButton = new LiveButton(); liveButton.setState(Config.LiveMapEnabeld.getDefaultValue()); Config.DisableLiveMap.addChangedEventListener(new IChanged() { @Override public void isChanged() { requestLayout(); } }); togBtn = new MultiToggleButton(GL_UISizes.Toggle, "toggle"); togBtn.addState("Free", new HSV_Color(Color.GRAY)); togBtn.addState("GPS", new HSV_Color(Color.GREEN)); togBtn.addState("WP", new HSV_Color(Color.MAGENTA)); togBtn.addState("Lock", new HSV_Color(Color.RED)); togBtn.addState("Car", new HSV_Color(Color.YELLOW)); togBtn.setLastStateWithLongClick(true); MapState last = MapState.values()[Config.LastMapToggleBtnState.getValue()]; togBtn.setState(last.ordinal()); togBtn.setOnStateChangedListener(new OnStateChangeListener() { @Override public void onStateChange(GL_View_Base v, int State) { setMapState(MapState.values()[State]); } }); togBtn.registerSkinChangedEvent(); switch (Mode) { case Compass: setMapState(MapState.GPS); break; case Normal: setMapState(last); break; case Track: setMapState(MapState.FREE); break; } if (Mode == MapMode.Normal) { switch (Config.LastMapToggleBtnState.getValue()) { case 0: info.setCoordType(CoordType.Map); break; case 1: info.setCoordType(CoordType.GPS); break; case 2: info.setCoordType(CoordType.Cache); break; case 3: info.setCoordType(CoordType.GPS); break; case 4: info.setCoordType(CoordType.GPS); break; } } if (Mode == MapMode.Normal) { this.addChild(togBtn); if (Config.DisableLiveMap.getValue()) { liveButton.setState(false); } this.addChild(liveButton); } infoBubble = new InfoBubble(GL_UISizes.Bubble, "infoBubble"); infoBubble.setInvisible(); infoBubble.setOnClickListener(new OnClickListener() { @Override public boolean onClick(GL_View_Base v, int x, int y, int pointer, int button) { if (infoBubble.saveButtonClicked(x, y)) { wd = CancelWaitDialog.ShowWait(Translation.Get("ReloadCacheAPI"), DownloadAnimation.GetINSTANCE(), new IcancelListener() { @Override public void isCanceld() { } }, new cancelRunnable() { @Override public void run() { String GcCode = infoBubble.getCache().getGcCode(); SearchGC searchC = new SearchGC(GcCode); searchC.number = 1; searchC.available = false; CB_List<Cache> apiCaches = new CB_List<Cache>(); ArrayList<LogEntry> apiLogs = new ArrayList<LogEntry>(); ArrayList<ImageEntry> apiImages = new ArrayList<ImageEntry>(); try { CB_UI.SearchForGeocaches.getInstance().SearchForGeocachesJSON(searchC, apiCaches, apiLogs, apiImages, infoBubble.getCache().getGPXFilename_ID(), this); Cache c = apiCaches.get(0); if (c.getGcCode() == GcCode) { c.setApiStatus(Cache.NOTLITE); } GroundspeakAPI.WriteCachesLogsImages_toDB(apiCaches, apiLogs, apiImages); } catch (InterruptedException e) { e.printStackTrace(); } // Reload result from DB synchronized (Database.Data.Query) { String sqlWhere = FilterInstances.getLastFilter() .getSqlWhere(Config.GcLogin.getValue()); CacheListDAO cacheListDAO = new CacheListDAO(); cacheListDAO.ReadCacheList(Database.Data.Query, sqlWhere, false, Config.ShowAllWaypoints.getValue()); } CacheListChangedEventList.Call(); Cache selCache = Database.Data.Query.GetCacheByGcCode(GcCode); GlobalCore.setSelectedCache(selCache); infoBubble.setCache(selCache, null, true); wd.close(); } @Override public boolean cancel() { // TODO handle cancel return false; } }); } else { if (infoBubble.getWaypoint() == null) { // Wenn ein Cache einen Final waypoint hat dann soll gleich dieser aktiviert werden Waypoint waypoint = infoBubble.getCache().GetFinalWaypoint(); // wenn ein Cache keine Final hat, aber einen StartWaypointm, dann wird dieser gleich selektiert if (waypoint == null) waypoint = infoBubble.getCache().GetStartWaypoint(); GlobalCore.setSelectedWaypoint(infoBubble.getCache(), waypoint); } else { GlobalCore.setSelectedWaypoint(infoBubble.getCache(), infoBubble.getWaypoint()); } } infoBubble.setInvisible(); return true; } }); if (Mode == MapMode.Normal) this.addChild(infoBubble); resize(rec.getWidth(), rec.getHeight()); try { center = new CoordinateGPS(Config.MapInitLatitude.getValue(), Config.MapInitLongitude.getValue()); } catch (Exception e) { e.printStackTrace(); } // Info aktualisieren if (Mode == MapMode.Normal) info.setCoord(center); aktZoom = Config.lastZoomLevel.getValue(); zoomBtn.setZoom(aktZoom); calcPixelsPerMeter(); mapScale.zoomChanged(); if ((center.getLatitude() == -1000) && (center.getLongitude() == -1000)) { // not initialized center = new CoordinateGPS(48, 12); } // Initial SettingsChanged Events MapView.that.SetNightMode(Config.nightMode.getValue()); Config.nightMode.addChangedEventListener(new IChanged() { @Override public void isChanged() { MapView.this.SetNightMode(Config.nightMode.getValue()); } }); MapView.that.SetNorthOriented(Config.MapNorthOriented.getValue()); Config.MapNorthOriented.addChangedEventListener(new IChanged() { @Override public void isChanged() { MapView.this.SetNorthOriented(Config.MapNorthOriented.getValue()); MapView.this.PositionChanged(); } }); }
From source file:CB_UI.RouteOverlay.java
License:Open Source License
private static void initialColorField() { ColorField[0] = Color.RED;/* w w w . j a v a2 s . com*/ ColorField[1] = Color.YELLOW; ColorField[2] = Color.BLACK; ColorField[3] = Color.LIGHT_GRAY; ColorField[4] = Color.GREEN; ColorField[5] = Color.BLUE; ColorField[6] = Color.CYAN; ColorField[7] = Color.GRAY; ColorField[8] = Color.MAGENTA; ColorField[9] = Color.ORANGE; ColorField[10] = Color.DARK_GRAY; ColorField[11] = Color.PINK; ColorField[12] = Color.WHITE; }
From source file:CB_UI_Base.GL_UI.Controls.MultiToggleButton.java
License:Open Source License
public void initialOn_Off_ToggleStates(String txtOn, String txtOff) { clearStates();//from w w w. ja v a2 s. c o m addState(txtOff, new HSV_Color(Color.GRAY)); addState(txtOn, COLOR.getHighLightFontColor()); setState(0, true); }