Java Code Examples for org.newdawn.slick.Color#blue()

The following examples show how to use org.newdawn.slick.Color#blue() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RendererSlick.java    From nullpomino with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public static Color getMeterColorAsColor(int meterColor) {
	switch(meterColor) {
	case GameEngine.METER_COLOR_PINK:		return new Color(255,  0,255);
	case GameEngine.METER_COLOR_PURPLE:		return new Color(128,  0,255);
	case GameEngine.METER_COLOR_DARKBLUE:	return new Color(  0,  0,128);
	case GameEngine.METER_COLOR_BLUE:		return Color.blue;
	case GameEngine.METER_COLOR_CYAN:		return Color.cyan;
	case GameEngine.METER_COLOR_DARKGREEN:	return new Color(  0,128,  0);
	case GameEngine.METER_COLOR_GREEN:		return Color.green;
	case GameEngine.METER_COLOR_YELLOW:		return Color.yellow;
	case GameEngine.METER_COLOR_ORANGE:		return Color.orange;
	case GameEngine.METER_COLOR_RED:		return Color.red;
	}
	
	return Color.white;
}
 
Example 2
Source File: GradientTest.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
/**
 * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer)
 */
public void init(GameContainer container) throws SlickException {
	this.container = container;

	rect = new Rectangle(400,100,200,150);
	round = new RoundedRectangle(150,100,200,150,50);
	round2 = new RoundedRectangle(150,300,200,150,50);
	center = new Rectangle(350,250,100,100);
	
	poly = new Polygon();
	poly.addPoint(400,350);
	poly.addPoint(550,320);
	poly.addPoint(600,380);
	poly.addPoint(620,450);
	poly.addPoint(500,450);
	
	gradient = new GradientFill(0,-75,Color.red,0,75,Color.yellow,true);
	gradient2 = new GradientFill(0,-75,Color.blue,0,75,Color.white,true);
	gradient4 = new GradientFill(-50,-40,Color.green,50,40,Color.cyan,true);
}
 
Example 3
Source File: MoveStoryboard.java    From opsu-dance with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void revalidate() {
	super.revalidate();

	btnAddLinear = new SimpleButton(width - 205, 50, 200, 25, Fonts.SMALL, "add linear", Colors.BLUE_BUTTON, Colors.WHITE_FADE, Colors.WHITE_FADE, Colors.ORANGE_BUTTON);
	btnAddQuadratic = new SimpleButton(width - 205, 80, 200, 25, Fonts.SMALL, "add quadratic", Colors.BLUE_BUTTON, Colors.WHITE_FADE, Colors.WHITE_FADE, Colors.ORANGE_BUTTON);
	btnAddCubic = new SimpleButton(width - 205, 110, 200, 25, Fonts.SMALL, "add cubic", Colors.BLUE_BUTTON, Colors.WHITE_FADE, Colors.WHITE_FADE, Colors.ORANGE_BUTTON);
	btnAnimLin = new SimpleButton(width - 250, 50, 40, 25, Fonts.SMALL, "lin", Color.blue, Color.white, Color.white, Color.orange);
	btnAnimMid = new SimpleButton(width - 250, 80, 40, 25, Fonts.SMALL, "mid", Color.blue, Color.white, Color.white, Color.orange);
	btnAnimCub = new SimpleButton(width - 250, 110, 40, 25, Fonts.SMALL, "cub", Color.blue, Color.white, Color.white, Color.orange);
}
 
Example 4
Source File: RendererSlick.java    From nullpomino with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Block colorIDDepending onSlickUseColorObjects created or received
 * @param colorID Block colorID
 * @return SlickUseColorObject
 */
public static Color getColorByID(int colorID) {
	switch(colorID) {
	case Block.BLOCK_COLOR_GRAY:   return new Color(Color.gray);
	case Block.BLOCK_COLOR_RED:    return new Color(Color.red);
	case Block.BLOCK_COLOR_ORANGE: return new Color(255,128,0);
	case Block.BLOCK_COLOR_YELLOW: return new Color(Color.yellow);
	case Block.BLOCK_COLOR_GREEN:  return new Color(Color.green);
	case Block.BLOCK_COLOR_CYAN:   return new Color(Color.cyan);
	case Block.BLOCK_COLOR_BLUE:   return new Color(Color.blue);
	case Block.BLOCK_COLOR_PURPLE: return new Color(Color.magenta);
	}
	return new Color(Color.black);
}
 
Example 5
Source File: QuadraticStoryboardMover.java    From opsu-dance with GNU General Public License v3.0 4 votes vote down vote up
public QuadraticStoryboardMover() {
	super(Color.magenta, Color.blue);
}
 
Example 6
Source File: TeamDraftStage.java    From FEMultiPlayer-V2 with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Instantiates a new team draft stage.
 *
 * @param s the s
 */
public TeamDraftStage(Session s){
	super("preparations");
	cursor = new Cursor();
	this.session = s;
	lastAction = "";
	controls = new ControlsDisplay();
	controls.addControl("Z", "Select");
	controls.addControl("Enter", "Done");
	addEntity(controls);
	hasControl = true;
	
	addEntity(new RunesBg(new Color(0xd2b48c)));
	List<Unit> vassals = UnitFactory.getVassals();
	List<Unit> lords = UnitFactory.getLords();
	
	lordList = new UnitList(LORD_LIST_X, LORD_LIST_Y, 2, 4);
	lordList.addUnits(lords);
	addEntity(lordList);
	
	vassalList = new UnitList(UNIT_LIST_X, UNIT_LIST_Y, 5, 4);
	vassalList.addUnits(vassals);
	vassalList.sort(new SortByName());
	addEntity(vassalList);
	classSort = new Button(CS_BUTTON_X, BUTTON_Y, "Sort By Class", Color.blue, 95) {
		public void execute() {
			vassalList.sort(new SortByClass());
			vassalList.refresh();
		}
	};
	nameSort = new Button(NS_BUTTON_X, BUTTON_Y, "Sort By Name", Color.blue, 95) {
		public void execute() {
			vassalList.sort(new SortByName());
			vassalList.refresh();
		}
	};
	submit = new Button(SB_BUTTON_X, BUTTON_Y, "Submit", Color.green, 95) {
		public void execute() {
			List<String> units = new ArrayList<String>();
			for(Unit u : lordList.getSelectedUnits()) {
				units.add(u.name);
			}
			for(Unit u : vassalList.getSelectedUnits()) {
				units.add(u.name);
			}
			if(units.size() < maxLords + maxVassals) {
				return;
			}
			DraftMessage msg = new DraftMessage(units.toArray(new String[units.size()]));
			FEMultiplayer.getClient().sendMessage(msg);
			hasControl = false;
		}
	};
	
	buttons = new Button[3];
	buttons[1] = nameSort;
	buttons[2] = classSort;
	buttons[0] = submit;
	addEntity(cursor);
	addEntity(classSort);
	addEntity(nameSort);
	addEntity(submit);
	
	Collections.shuffle(vassals);
	Collections.shuffle(lords);
	
	// Draft order initialization
	// [Blue/Red] [Lord, Ban, Pick]
	draftOrder = draftOrders[session.getMaxUnits()-1];
	draftTurn = -1;
	
	// Timers
	timers = new ArrayList<DraftTimer>();
	for(Player p : session.getNonSpectators()) {
		int x = p.getParty().getColor().equals(Party.TEAM_BLUE) ? 5 : 410;
		float totalTime = Math.round(TIME_PER_TURN * draftOrder.length / 5.0f) * 5 + BASE_TIME;
		DraftTimer dt = new DraftTimer(x, 277, totalTime, Math.round(totalTime/12), p);
		addEntity(dt);
		timers.add(dt);
	}
	
	resetDraft();
	refresh();
}
 
Example 7
Source File: DraftViewStage.java    From FEMultiPlayer-V2 with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Instantiates a new team draft stage.
 *
 * @param s the s
 */
public DraftViewStage(Session s){
	super("preparations");
	this.session = s;
	lastAction = "";
	controls = new ControlsDisplay();
	controls.addControl("Z", "Select");
	controls.addControl("Enter", "Done");
	addEntity(controls);
	hasControl = true;
	
	addEntity(new RunesBg(new Color(0xd2b48c)));
	List<Unit> vassals = UnitFactory.getVassals();
	List<Unit> lords = UnitFactory.getLords();
	
	lordList = new UnitList(LORD_LIST_X, LORD_LIST_Y, 2, 4);
	lordList.addUnits(lords);
	addEntity(lordList);
	
	vassalList = new UnitList(UNIT_LIST_X, UNIT_LIST_Y, 5, 4);
	vassalList.addUnits(vassals);
	vassalList.sort(new SortByName());
	addEntity(vassalList);
	classSort = new Button(CS_BUTTON_X, BUTTON_Y, "Sort By Class", Color.blue, 95) {
		public void execute() {
			vassalList.sort(new SortByClass());
			vassalList.refresh();
		}
	};
	nameSort = new Button(NS_BUTTON_X, BUTTON_Y, "Sort By Name", Color.blue, 95) {
		public void execute() {
			vassalList.sort(new SortByName());
			vassalList.refresh();
		}
	};
	submit = new Button(SB_BUTTON_X, BUTTON_Y, "Submit", Color.green, 95) {
		public void execute() {
			List<String> units = new ArrayList<String>();
			for(Unit u : lordList.getSelectedUnits()) {
				units.add(u.name);
			}
			for(Unit u : vassalList.getSelectedUnits()) {
				units.add(u.name);
			}
			if(units.size() < maxLords + maxVassals) {
				return;
			}
			DraftMessage msg = new DraftMessage(units.toArray(new String[units.size()]));
			FEMultiplayer.getClient().sendMessage(msg);
			hasControl = false;
		}
	};
	
	buttons = new Button[3];
	buttons[1] = nameSort;
	buttons[2] = classSort;
	buttons[0] = submit;
	addEntity(classSort);
	addEntity(nameSort);
	addEntity(submit);
	
	Collections.shuffle(vassals);
	Collections.shuffle(lords);
	
	// Draft order initialization
	// [Blue/Red] [Lord, Ban, Pick]
	draftOrder = draftOrders[session.getMaxUnits()-1];
	draftTurn = -1;
	
	// Timers
	timers = new ArrayList<DraftTimer>();
	for(Player p : session.getNonSpectators()) {
		int x = p.getParty().getColor().equals(Party.TEAM_BLUE) ? 5 : 410;
		float totalTime = Math.round(TIME_PER_TURN * draftOrder.length / 5.0f) * 5 + BASE_TIME;
		DraftTimer dt = new DraftTimer(x, 277, totalTime, Math.round(totalTime/12), p);
		addEntity(dt);
		timers.add(dt);
	}
	
	resetDraft();
	refresh();
}
 
Example 8
Source File: TeamSelectionStage.java    From FEMultiPlayer-V2 with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Instantiates a new team selection stage.
 *
 * @param stage the stage
 * @param s the s
 */
public TeamSelectionStage(TeamBuilderStage stage, Session s){
	super("preparations");
	builderStage = stage;
	if(s == null)
		maxUnits = 8;
	else
		maxUnits = s.getMaxUnits();
	cursor = new Cursor();
	controls = new ControlsDisplay();
	controls.addControl("Z", "Select");
	controls.addControl("Enter", "Done");
	addEntity(controls);
	
	addEntity(new RunesBg(new Color(0xd2b48c)));
	List<Unit> vassals = UnitFactory.getVassals();
	List<Unit> lords = UnitFactory.getLords();
	
	lordList = new UnitList(LORD_LIST_X, LORD_LIST_Y, 2, 5);
	lordList.addUnits(lords);
	addEntity(lordList);
	
	vassalList = new UnitList(UNIT_LIST_X, UNIT_LIST_Y, 5, 5);
	vassalList.addUnits(vassals);
	vassalList.sort(new SortByName());
	addEntity(vassalList);
	ok = new Button(OK_BUTTON_X, BUTTON_Y, "OK", Color.green, 95) {
		public void execute() {
			builderStage.setUnits(getSelectedUnits());
			builderStage.refresh();
			FEMultiplayer.setCurrentStage(builderStage);
		}
	};
	classSort = new Button(CS_BUTTON_X, BUTTON_Y, "Sort By Class", Color.blue, 95) {
		public void execute() {
			vassalList.sort(new SortByClass());
			vassalList.refresh();
		}
	};
	nameSort = new Button(NS_BUTTON_X, BUTTON_Y, "Sort By Name", Color.blue, 95) {
		public void execute() {
			vassalList.sort(new SortByName());
			vassalList.refresh();
		}
	};
	
	buttons = new Button[3];
	buttons[0] = ok;
	buttons[1] = nameSort;
	buttons[2] = classSort;
	addEntity(cursor);
	addEntity(ok);
	addEntity(classSort);
	addEntity(nameSort);
	
	Collections.shuffle(vassals);
	Collections.shuffle(lords);
	
	for(int i = 0; i < maxUnits-1; i++){
		selectUnit(vassals.get(i));
	}
	selectUnit(lords.get(0));
	
	refresh();
}
 
Example 9
Source File: TeamDraftStage.java    From FEMultiplayer with GNU General Public License v3.0 4 votes vote down vote up
public TeamDraftStage(Session s){
		super("preparations");
		cursor = new Cursor();
		this.session = s;
		lastAction = "";
		controls = new ControlsDisplay();
		controls.addControl("Z", "Select");
		controls.addControl("Enter", "Done");
		addEntity(controls);
		hasControl = true;
		
		addEntity(new RunesBg(new Color(0xd2b48c)));
		List<Unit> vassals = UnitFactory.getVassals();
		List<Unit> lords = UnitFactory.getLords();
		
		lordList = new UnitList(LORD_LIST_X, LORD_LIST_Y, 2, 4);
		lordList.addUnits(lords);
		addEntity(lordList);
		
		vassalList = new UnitList(UNIT_LIST_X, UNIT_LIST_Y, 5, 4);
		vassalList.addUnits(vassals);
		vassalList.sort(new SortByName());
		addEntity(vassalList);
		//TODO: Modifiers
//		if(s != null) {
//			for(Modifier m : s.getModifiers()) {
//				m.modifyUnits(this);
//			}
//		}
		classSort = new Button(CS_BUTTON_X, BUTTON_Y, "Sort By Class", Color.blue, 95) {
			public void execute() {
				vassalList.sort(new SortByClass());
				vassalList.refresh();
			}
		};
		nameSort = new Button(NS_BUTTON_X, BUTTON_Y, "Sort By Name", Color.blue, 95) {
			public void execute() {
				vassalList.sort(new SortByName());
				vassalList.refresh();
			}
		};
		submit = new Button(SB_BUTTON_X, BUTTON_Y, "Submit", Color.green, 95) {
			public void execute() {
				List<String> units = new ArrayList<String>();
				for(Unit u : lordList.getSelectedUnits()) {
					units.add(u.name);
				}
				for(Unit u : vassalList.getSelectedUnits()) {
					units.add(u.name);
				}
				if(units.size() < maxLords + maxVassals) {
					return;
				}
				DraftMessage msg = new DraftMessage(units.toArray(new String[units.size()]));
				FEMultiplayer.getClient().sendMessage(msg);
				hasControl = false;
			}
		};
		
		buttons = new Button[3];
		buttons[1] = nameSort;
		buttons[2] = classSort;
		buttons[0] = submit;
		addEntity(cursor);
		addEntity(classSort);
		addEntity(nameSort);
		addEntity(submit);
		
		Collections.shuffle(vassals);
		Collections.shuffle(lords);
		
		// Draft order initialization
		// [Blue/Red] [Lord, Ban, Pick]
		draftOrder = draftOrders[session.getMaxUnits()-1];
		draftTurn = -1;
		
		// Timers
		timers = new ArrayList<DraftTimer>();
		for(Player p : session.getPlayers()) {
			if(p.isSpectator()) continue;
			int x = p.getParty().getColor().equals(Party.TEAM_BLUE) ? 5 : 410;
			float totalTime = Math.round(TIME_PER_TURN * draftOrder.length / 5.0f) * 5 + BASE_TIME;
			DraftTimer dt = new DraftTimer(x, 277, totalTime, Math.round(totalTime/12), p);
			addEntity(dt);
			timers.add(dt);
		}
		
		resetDraft();
		refresh();
	}
 
Example 10
Source File: TeamSelectionStage.java    From FEMultiplayer with GNU General Public License v3.0 4 votes vote down vote up
public TeamSelectionStage(TeamBuilderStage stage, Session s){
	super("preparations");
	builderStage = stage;
	if(s == null)
		maxUnits = 8;
	else
		maxUnits = s.getMaxUnits();
	cursor = new Cursor();
	controls = new ControlsDisplay();
	controls.addControl("Z", "Select");
	controls.addControl("Enter", "Done");
	addEntity(controls);
	
	addEntity(new RunesBg(new Color(0xd2b48c)));
	List<Unit> vassals = UnitFactory.getVassals();
	List<Unit> lords = UnitFactory.getLords();
	
	lordList = new UnitList(LORD_LIST_X, LORD_LIST_Y, 2, 5);
	lordList.addUnits(lords);
	addEntity(lordList);
	
	vassalList = new UnitList(UNIT_LIST_X, UNIT_LIST_Y, 5, 5);
	vassalList.addUnits(vassals);
	vassalList.sort(new SortByName());
	addEntity(vassalList);
	if(s != null) {
		for(Modifier m : s.getModifiers()) {
			m.modifyUnits(this);
		}
	}
	ok = new Button(OK_BUTTON_X, BUTTON_Y, "OK", Color.green, 95) {
		public void execute() {
			builderStage.setUnits(getSelectedUnits());
			builderStage.refresh();
			FEMultiplayer.setCurrentStage(builderStage);
		}
	};
	classSort = new Button(CS_BUTTON_X, BUTTON_Y, "Sort By Class", Color.blue, 95) {
		public void execute() {
			vassalList.sort(new SortByClass());
			vassalList.refresh();
		}
	};
	nameSort = new Button(NS_BUTTON_X, BUTTON_Y, "Sort By Name", Color.blue, 95) {
		public void execute() {
			vassalList.sort(new SortByName());
			vassalList.refresh();
		}
	};
	
	buttons = new Button[3];
	buttons[0] = ok;
	buttons[1] = nameSort;
	buttons[2] = classSort;
	addEntity(cursor);
	addEntity(ok);
	addEntity(classSort);
	addEntity(nameSort);
	
	Collections.shuffle(vassals);
	Collections.shuffle(lords);
	
	for(int i = 0; i < maxUnits-1; i++){
		selectUnit(vassals.get(i));
	}
	selectUnit(lords.get(0));
	
	refresh();
}