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.torrosoft.sopistan.SopistanMain.java
License:Open Source License
void drawDebug() { Array<Vector2> input = swipe.getInput(); // draw the raw input shapes.begin(ShapeType.Line); shapes.setColor(Color.GRAY);//from w w w . j av a 2s . c o m for (int i = 0; i < input.size - 1; i++) { Vector2 p = input.get(i); Vector2 p2 = input.get(i + 1); shapes.line(p.x, p.y, p2.x, p2.y); } shapes.end(); // draw the smoothed and simplified path shapes.begin(ShapeType.Line); shapes.setColor(Color.RED); Array<Vector2> out = swipe.getPath(); for (int i = 0; i < out.size - 1; i++) { Vector2 p = out.get(i); Vector2 p2 = out.get(i + 1); shapes.line(p.x, p.y, p2.x, p2.y); } shapes.end(); // render our perpendiculars shapes.begin(ShapeType.Line); Vector2 perp = new Vector2(); for (int i = 1; i < input.size - 1; i++) { Vector2 p = input.get(i); Vector2 p2 = input.get(i + 1); shapes.setColor(Color.LIGHT_GRAY); perp.set(p).sub(p2).nor(); perp.set(perp.y, -perp.x); perp.scl(10f); shapes.line(p.x, p.y, p.x + perp.x, p.y + perp.y); perp.scl(-1f); shapes.setColor(Color.BLUE); shapes.line(p.x, p.y, p.x + perp.x, p.y + perp.y); } shapes.end(); }
From source file:com.tumblr.oddlydrawn.stupidworm.MainMenuInterface.java
License:Apache License
private void setUpSkin() { Pixmap pixmap = new Pixmap(1, 1, Format.RGBA8888); pixmap.setColor(Color.LIGHT_GRAY); pixmap.fill();/*from ww w . j av a2s. c o m*/ skin.add("grey", new Texture(pixmap)); titleSprite.setX(TITLE_SPRITE_POS_X); titleSprite.setY(TITLE_SPRITE_POS_Y); LabelStyle labelStyle = new LabelStyle(); skin.add("default", finePrint); labelStyle.font = skin.getFont("default"); skin.add("default", labelStyle); CheckBoxStyle checkBoxStyle = new CheckBoxStyle(); checkBoxStyle.checkboxOff = skin.newDrawable("grey", Color.LIGHT_GRAY); checkBoxStyle.checkboxOn = skin.newDrawable("grey", Color.LIGHT_GRAY); checkBoxStyle.font = skin.getFont("default"); checkBoxStyle.checkboxOff = new TextureRegionDrawable(unchecked); checkBoxStyle.checkboxOn = new TextureRegionDrawable(checked); skin.add("default", checkBoxStyle); SliderStyle sliderStyle = new SliderStyle(); sliderStyle.background = new TextureRegionDrawable(background); sliderStyle.knob = new TextureRegionDrawable(knob); skin.add("default-horizontal", sliderStyle); ButtonStyle buttonStyle = new ButtonStyle(); skin.add("default", buttonStyle); TextButtonStyle textButtonStyle = new TextButtonStyle(); textButtonStyle.font = skin.getFont("default"); textButtonStyle.up = new NinePatchDrawable(patchBox); skin.add("default", textButtonStyle); }
From source file:com.tumblr.oddlydrawn.stupidworm.screens.LicenseScreen.java
License:Apache License
public LicenseScreen(Game g) { game = g;/* w w w. j a va 2 s . c om*/ stage = new Stage(); skin = new Skin(); batch = new SpriteBatch(); FileHandle handle; handle = Gdx.files.internal(LICENSE_LOC); licenseString = handle.readString(); atlas = new TextureAtlas(Gdx.files.internal(TEXTURE_ATLAS_LOC)); NinePatch patchBox; patchBox = new NinePatch(atlas.createPatch(PATCH_BOX_REGION_STRING)); Gdx.input.setInputProcessor(stage); stage.setViewport(new StretchViewport(WIDTH, HEIGHT)); Table table = new Table(); table.setFillParent(true); stage.addActor(table); Pixmap pixmap = new Pixmap(1, 1, Format.RGBA8888); pixmap.setColor(Color.LIGHT_GRAY); pixmap.fill(); // The following defines the defaults for Scene2D's skin skin.add("grey", new Texture(pixmap)); skin.add("default", new BitmapFont(Gdx.files.internal(FONT_LOC))); LabelStyle labelStyle = new LabelStyle(); labelStyle.font = skin.getFont("default"); skin.add("default", labelStyle); ScrollPaneStyle scrollPaneStyle = new ScrollPaneStyle(); skin.add("default", scrollPaneStyle); ButtonStyle buttonStyle = new ButtonStyle(); skin.add("default", buttonStyle); TextButtonStyle textButtonStyle = new TextButtonStyle(); textButtonStyle.font = skin.getFont("default"); textButtonStyle.up = new NinePatchDrawable(patchBox); skin.add("default", textButtonStyle); // Creates Actors (the entire LICENSE text file) for Scene2D Label license = new Label(licenseString, skin); ScrollPane scrollPane = new ScrollPane(license, skin); scrollPane.setFlickScroll(true); table.add(scrollPane); // Creates the padding between the text and the button. table.row(); // Label padding = new Label(LABEL_PADDING, skin); // table.add(padding); // Creates the 'Okay' button table.row(); TextButton okay = new TextButton("Okay", skin); table.add(okay); okay.addListener(new ChangeListener() { public void changed(ChangeEvent event, Actor actor) { dispose(); game.setScreen(new MainMenuScreen(game)); } }); // Adds padding on top and on the bottom of the table. table.padTop(TABLE_PADDING); table.padBottom(TABLE_PADDING); table.pack(); }
From source file:com.wotf.gui.view.SessionLocal.java
/** * {@inheritDoc}//from w ww. j a v a2 s . c o m */ @Override public void show() { stage = new Stage(); Gdx.input.setInputProcessor(stage);// Make the stage consume events //System.out.println(Gdx.files.internal("maps")); skin = new Skin(Gdx.files.internal("uiskin.json")); teams = new List(skin); // Alle teams en labels hiervoor. Table teamstable = new Table(); Table mapstable = new Table(); Table settingstable = new Table(); Table teamselecttable = new Table(); teamstable.setBackground(new NinePatchDrawable(getNinePatch(("GUI/tblbg.png"), 150, 150, 160, 160))); mapstable.setBackground(new NinePatchDrawable(getNinePatch(("GUI/tblbg.png"), 220, 220, 160, 160))); teamselecttable.setBackground(new NinePatchDrawable(getNinePatch(("GUI/tblbg.png"), 100, 100, 160, 160))); Label selectteamlabel = new Label("Team selection", skin); teamselecttable.add(selectteamlabel).padBottom(15); teamselecttable.row(); TextButton btnteamalpha = new TextButton("Alpha", skin); // Use the initialized skin btnteamalpha.setColor(Color.BLUE); btnteamalpha.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { Team teamalpha = new Team("Alpha", Color.BLUE); teamalpha.setPlayer(defaultPlayer); teamalpha.setColorname(teamalpha.getColor().toString()); int selectedunitcount = Integer.parseInt(unitbox.getSelected().toString()); addUnitsSingleTeam(selectedunitcount, teamalpha); btnteamalpha.setTouchable(Touchable.disabled); btnteamalpha.setColor(Color.LIGHT_GRAY); } }); teamselecttable.add(btnteamalpha).padBottom(10).width(150).height(50); teamselecttable.row(); TextButton btnteambeta = new TextButton("Beta", skin); // Use the initialized skin btnteambeta.setColor(Color.CORAL); btnteambeta.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { Team teambeta = new Team("Beta", Color.CORAL); teambeta.setPlayer(defaultPlayer); teambeta.setColorname(teambeta.getColor().toString()); int selectedunitcount = Integer.parseInt(unitbox.getSelected().toString()); addUnitsSingleTeam(selectedunitcount, teambeta); btnteambeta.setTouchable(Touchable.disabled); btnteambeta.setColor(Color.LIGHT_GRAY); } }); teamselecttable.add(btnteambeta).padBottom(10).width(150).height(50); teamselecttable.row(); TextButton btnteamgamma = new TextButton("Gamma", skin); // Use the initialized skin btnteamgamma.setColor(Color.GREEN); btnteamgamma.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { Team teamgamma = new Team("Gamma", Color.GREEN); teamgamma.setPlayer(defaultPlayer); teamgamma.setColorname(teamgamma.getColor().toString()); int selectedunitcount = Integer.parseInt(unitbox.getSelected().toString()); addUnitsSingleTeam(selectedunitcount, teamgamma); btnteamgamma.setTouchable(Touchable.disabled); btnteamgamma.setColor(Color.LIGHT_GRAY); } }); teamselecttable.add(btnteamgamma).width(150).height(50); teamselecttable.setWidth(200); teamselecttable.setHeight(320); teamselecttable.setPosition(500, 360); stage.addActor(teamselecttable); Label wotflabel = new Label("War of the Figures", skin); wotflabel.setPosition(Gdx.graphics.getWidth() / 2 - wotflabel.getWidth() / 2, 740); stage.addActor(wotflabel); Label iplabel = new Label("IP :", skin); settingstable.add(iplabel).width(120); Label ipvallabel = new Label("127.0.0.1", skin); settingstable.add(ipvallabel).width(180); settingstable.row(); Object[] turntimevals = new Object[6]; turntimevals[0] = "10"; turntimevals[1] = "20"; turntimevals[2] = "30"; turntimevals[3] = "40"; turntimevals[4] = "50"; turntimevals[5] = "60"; Label turntimelabel = new Label("Turn Time :", skin); settingstable.add(turntimelabel).width(120); SelectBox turntimebox = new SelectBox(skin); turntimebox.setItems(turntimevals); turntimebox.setSelectedIndex(3); turntimebox.addListener(new ChangeListener() { @Override public void changed(ChangeListener.ChangeEvent event, Actor actor) { gameSettings.setTurnTime(Integer.parseInt(turntimebox.getSelected().toString())); } }); settingstable.add(turntimebox).width(180); settingstable.row(); Object[] physicsvals = new Object[2]; physicsvals[0] = "True"; physicsvals[1] = "False"; Label physicslabel = new Label("Physics :", skin); settingstable.add(physicslabel).width(120); SelectBox physicsbox = new SelectBox(skin); physicsbox.setItems(physicsvals); physicsbox.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { gameSettings.setPhysics(Boolean.parseBoolean(physicsbox.getSelected().toString())); } }); settingstable.add(physicsbox).width(180); settingstable.row(); Object[] weaponsvals = new Object[3]; weaponsvals[0] = "All Weapons"; weaponsvals[1] = "Non-Explosive"; weaponsvals[2] = "Grenades Only"; Label weaponslabel = new Label("Weapons :", skin); settingstable.add(weaponslabel).width(120); SelectBox weaponsbox = new SelectBox(skin); weaponsbox.setItems(weaponsvals); settingstable.add(weaponsbox).width(180); settingstable.row(); Object[] timervals = new Object[3]; timervals[0] = "60"; timervals[1] = "30"; timervals[2] = "10"; Label timerlabel = new Label("Timer :", skin); settingstable.add(timerlabel).width(120); SelectBox timerbox = new SelectBox(skin); timerbox.setItems(timervals); timerbox.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { gameSettings.setMaxTime(Integer.parseInt(timerbox.getSelected().toString())); } }); settingstable.add(timerbox).width(180); settingstable.row(); Object[] unitvals = new Object[4]; unitvals[0] = "1"; unitvals[1] = "2"; unitvals[2] = "3"; unitvals[3] = "4"; Label unitlabel = new Label("Units :", skin); settingstable.add(unitlabel).width(120); unitbox = new SelectBox(skin); unitbox.setItems(unitvals); unitbox.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { int selectedunitcount = Integer.parseInt(unitbox.getSelected().toString()); gameSettings.setMaxUnitCount(selectedunitcount); refreshUnitsForTeam(selectedunitcount); } }); settingstable.add(unitbox).width(180); settingstable.setWidth(300); settingstable.setHeight(200); settingstable.setPosition(30, 110); stage.addActor(settingstable); ArrayList<String> mapslist = new ArrayList<>(); FileHandle dirHandle = Gdx.files.internal("maps"); for (FileHandle entry : dirHandle.list()) { mapslist.add(entry.toString()); } map1 = new Image(new Texture(mapslist.get(0))); map1.setPosition(20, 70); map1.setWidth(400); map1.setHeight(230); mapstable.addActor(map1); SelectBox chooseMap = new SelectBox(skin); chooseMap.setItems(mapslist.toArray()); chooseMap.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { mapstable.removeActor(map1); map1 = new Image(new Texture(mapslist.get(chooseMap.getSelectedIndex()))); map1.setPosition(20, 70); map1.setWidth(400); map1.setHeight(230); map1.invalidate(); mapstable.addActor(map1); // Table image is not updating for some reason. Does it need to be redrawn? Or the Stage? } }); chooseMap.setWidth(400); chooseMap.setPosition(20, 20); mapstable.addActor(chooseMap); mapstable.setPosition(30, 360); mapstable.setHeight(320); mapstable.setWidth(440); stage.addActor(mapstable); Label teamslabel = new Label("Teams", skin); teamstable.setPosition(730, 360); teamstable.add(teamslabel); teamstable.row(); teamstable.add(teams).width(200); teamstable.setWidth(300); teamstable.setHeight(320); stage.addActor(teamstable); TextButton start = new TextButton("Start", skin); // Use the initialized skin start.setColor(Color.BLACK); start.setWidth(300); start.setHeight(60); start.setPosition(590, 180); stage.addActor(start); start.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { if (teamList.size() < 2) { return; } // Selected MaxTime to an integer. gameSettings.setMaxTime(Integer.parseInt(timerbox.getSelected().toString())); // Selected TurnTime to an integer. gameSettings.setTurnTime(Integer.parseInt(turntimebox.getSelected().toString())); gameSettings.setIsLocal(true); // Create the map Map map = new Map(chooseMap.getSelected().toString().substring(5)); try { sessionLocal = new Session(defaultPlayer, "localHost", gameSettings); sessionLocal.addPlayer(defaultPlayer); } catch (RemoteException ex) { Gdx.app.log("SessionLocal", ex.getMessage()); } game.setScreen(new GameEngine(game, gameSettings, map, sessionLocal, defaultPlayer)); } }); TextButton exit = new TextButton("Exit", skin); // Use the initialized skin exit.setColor(Color.BLACK); exit.setWidth(300); exit.setHeight(60); exit.setPosition(590, 110); stage.addActor(exit); exit.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { game.setScreen(new MainMenu(game)); } }); }
From source file:edu.franklin.practicum.f15.strategygame.StrategyGame.java
private void initSkin() { uiSkin = new Skin(Gdx.files.internal("ui/uiskin.json")); Pixmap pm = new Pixmap(1, 1, Pixmap.Format.RGBA8888); pm.setColor(Color.WHITE);/*from w w w . ja v a 2s. co m*/ pm.fill(); uiSkin.add("white", new Texture(pm)); uiSkin.add("default", new BitmapFont()); Texture tex = new Texture(Gdx.files.internal("ui/dark_gray.png")); NinePatch dgnp = new NinePatch(tex, 10, 10, 10, 10); uiSkin.add("dght", dgnp); TextButton.TextButtonStyle tbs = new TextButton.TextButtonStyle(); tbs.up = uiSkin.newDrawable("white", Color.DARK_GRAY); tbs.down = uiSkin.newDrawable("white", Color.DARK_GRAY); tbs.checked = uiSkin.newDrawable("white", Color.BLUE); tbs.over = uiSkin.newDrawable("white", Color.LIGHT_GRAY); tbs.font = uiSkin.getFont("default"); uiSkin.add("default", tbs); // logBuffer = ""; }
From source file:es.eucm.ead.editor.view.ui.effects.EndgameWidget.java
License:Open Source License
@Override protected Color getBackgroundColor() { return Color.LIGHT_GRAY; }
From source file:es.eucm.ead.engine.utils.assetviewer.AssetApplicationListener.java
License:Open Source License
private void createBackgroundPattern() { Pixmap square = new Pixmap(patternSize * 2, patternSize, Pixmap.Format.RGB888); square.setColor(Color.GRAY);// w ww.j a v a 2 s. c o m square.fillRectangle(0, 0, patternSize, patternSize); square.setColor(Color.LIGHT_GRAY); square.fillRectangle(patternSize, 0, patternSize, patternSize); squareTexture = new Texture(square); square.dispose(); }
From source file:genuini.game.SkinManager.java
/** * Create a white button by default//from ww w . j av a 2 s . c o m * * @param width : text's width * @param height : text's height * @return skin : the button's skin */ public Skin createButtonSkin(int width, int height) { //text's creation this.textSkin(Color.WHITE, false, width, height); //Create a button style TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle(); textButtonStyle.up = skin.newDrawable("background", Color.WHITE); 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); return skin; }
From source file:genuini.game.SkinManager.java
/** * Create a button with parameters and the dark backgroud by default * * @param width : text's width//from w ww.j a v a 2 s. c o m * @param height : text's height * @param color : text's color * @param dark : 1 if the color is dark ; 0 if it's light * @return skin : the button's skin */ public Skin createButtonSkin(int width, int height, Color color, boolean dark) { //text's creation this.textSkin(color, dark, width, height); //Create a button style TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle(); textButtonStyle.up = skin.newDrawable("background", Color.WHITE); 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); return skin; }
From source file:kyle.game.besiege.Faction.java
License:Open Source License
public static void initializeFactions(Kingdom kingdom) { factions = new Array<Faction>(); factionRelations = new Array<Array<Integer>>(); // factionMilitaryAction = new Array<Array<Integer>>(); // add player faction (index 0) createFaction(PLAYER_FACTION);/*from w w w .j av a 2 s.co m*/ // add bandits faction (index 1) createFaction(BANDITS_FACTION); createFaction("Geinever", "crestWhiteLion", Color.DARK_GRAY); createFaction("Weyvel", "crestGreenTree", OLIVE); createFaction("Rolade", "crestOrangeCross", BROWN); createFaction("Myrnfar", "crestYellowStar", TAN); createFaction("Corson", "crestRedCross", RED); createFaction("Selven", "crestGreenStripe", GREEN); createFaction("Halmera", "crestBlueRose", BLUE); createFaction("Fernel", "crestBlank", Color.LIGHT_GRAY); createFaction("Draekal", "crestBlank", Color.MAGENTA); for (Faction f : factions) { f.kingdom = kingdom; } factions.get(2).declareWar(factions.get(3)); // factionRelations = new int[factionCount][factionCount]; for (int i = 0; i < factionCount; i++) { for (int j = 0; j < factionCount; j++) { // factionRelations[i][j] = -30; factionRelations.get(i).set(j, -30); factionRelations.get(j).set(i, -30); } } for (int i = 0; i < factionCount; i++) { // factionRelations[i][i] = 100; factionRelations.get(i).set(i, 100); } }