Java Code Examples for org.newdawn.slick.Graphics#drawImage()

The following examples show how to use org.newdawn.slick.Graphics#drawImage() . These examples are extracted from open source projects. 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
@Override
protected void renderImpl(GameContainer container, StateBasedGame game, Graphics g) throws SlickException {
	// Background
	g.drawImage(ResourceHolderSlick.imgMenu, 0, 0);

	// Menu
	NormalFontSlick.printFontGrid(1, 1, "OPTIONS", NormalFontSlick.COLOR_ORANGE);

	NormalFontSlick.printFontGrid(1, 3 + cursor, "b", NormalFontSlick.COLOR_RED);

	NormalFontSlick.printFontGrid(2, 3, "[GENERAL OPTIONS]", (cursor == 0));
	NormalFontSlick.printFontGrid(2, 4, "[RULE SELECT]:" + (player + 1) + "P", (cursor == 1));
	NormalFontSlick.printFontGrid(2, 5, "[GAME TUNING]:" + (player + 1) + "P", (cursor == 2));
	NormalFontSlick.printFontGrid(2, 6, "[AI SETTING]:" + (player + 1) + "P", (cursor == 3));
	NormalFontSlick.printFontGrid(2, 7, "[KEYBOARD SETTING]:" + (player + 1) + "P", (cursor == 4));
	NormalFontSlick.printFontGrid(2, 8, "[KEYBOARD NAVIGATION SETTING]:" + (player + 1) + "P", (cursor == 5));
	NormalFontSlick.printFontGrid(2, 9, "[KEYBOARD RESET]:" + (player + 1) + "P", (cursor == 6));
	NormalFontSlick.printFontGrid(2, 10, "[JOYSTICK SETTING]:" + (player + 1) + "P", (cursor == 7));

	NormalFontSlick.printTTFFont(16, 432, NullpoMinoSlick.getUIText(UI_TEXT[cursor]));
}
 
Example 2
@Override
protected void renderImpl(GameContainer container, StateBasedGame game, Graphics g) throws SlickException {
	// Background
	g.drawImage(ResourceHolderSlick.imgMenu, 0, 0);

	// Menu
	NormalFontSlick.printFontGrid(1, 1, "KEYBOARD RESET (" + (player+1) + "P)", NormalFontSlick.COLOR_ORANGE);

	NormalFontSlick.printFontGrid(1, 3, "RESET SETTINGS TO...", NormalFontSlick.COLOR_GREEN);

	NormalFontSlick.printFontGrid(1, 4 + cursor, "b", NormalFontSlick.COLOR_RED);

	NormalFontSlick.printFontGrid(2, 4, "BLOCKBOX STYLE (DEFAULT)", (cursor == 0));
	NormalFontSlick.printFontGrid(2, 5, "GUIDELINE STYLE", (cursor == 1));
	NormalFontSlick.printFontGrid(2, 6, "NULLPOMINO CLASSIC STYLE", (cursor == 2));
}
 
Example 3
@Override
protected void renderImpl(GameContainer container, StateBasedGame game, Graphics g) throws SlickException {
	// Background
	g.drawImage(ResourceHolderSlick.imgTitle, 0, 0);

	// Menu
	NormalFontSlick.printFontGrid(1, 1, "NULLPOMINO", NormalFontSlick.COLOR_ORANGE);
	NormalFontSlick.printFontGrid(1, 2, "VERSION " + GameManager.getVersionString(), NormalFontSlick.COLOR_ORANGE);

	renderChoices(2, 4, CHOICES);

	NormalFontSlick.printTTFFont(16, 432, NullpoMinoSlick.getUIText(UI_TEXT[cursor]));

	if(UpdateChecker.isNewVersionAvailable(GameManager.getVersionMajor(), GameManager.getVersionMinor())) {
		String strTemp = String.format(NullpoMinoSlick.getUIText("Title_NewVersion"),
				UpdateChecker.getLatestVersionFullString(), UpdateChecker.getStrReleaseDate());
		NormalFontSlick.printTTFFont(16, 416, strTemp);
	}
}
 
Example 4
@Override
protected void renderImpl(GameContainer container, StateBasedGame game, Graphics graphics) throws SlickException {
	// Background
	graphics.drawImage(ResourceHolderSlick.imgMenu, 0, 0);

	// Menu
	if(list == null) {
		NormalFontSlick.printFontGrid(1, 1, nullError, NormalFontSlick.COLOR_RED);
	} else if(list.length == 0) {
		NormalFontSlick.printFontGrid(1, 1, emptyError, NormalFontSlick.COLOR_RED);
	} else {
		if (cursor >= list.length)
			cursor = 0;
		if (cursor < minentry)
			minentry = cursor;
		int maxentry = minentry + pageHeight - 1;
		if (cursor >= maxentry)
		{
			maxentry = cursor;
			minentry = maxentry - pageHeight + 1;
		}
		drawMenuList(graphics);
		onRenderSuccess(container, game, graphics);
	}
}
 
Example 5
@Override
protected void renderImpl(GameContainer container, StateBasedGame game, Graphics g) throws SlickException {
	// Menu
	g.drawImage(ResourceHolderSlick.imgMenu, 0, 0);

	NormalFontSlick.printFontGrid(1, 1, "JOYSTICK SETTING (" + (player+1) + "P)", NormalFontSlick.COLOR_ORANGE);

	NormalFontSlick.printFontGrid(1, 3 + cursor, "b", NormalFontSlick.COLOR_RED);

	NormalFontSlick.printFontGrid(2, 3, "[BUTTON SETTING]", (cursor == 0));
	NormalFontSlick.printFontGrid(2, 4, "[INPUT TEST]", (cursor == 1));
	NormalFontSlick.printFontGrid(2, 5, "JOYSTICK NUMBER:" + ((joyUseNumber == -1) ? "NOTHING" : String.valueOf(joyUseNumber)), (cursor == 2));
	NormalFontSlick.printFontGrid(2, 6, "JOYSTICK BORDER:" + joyBorder, (cursor == 3));
	NormalFontSlick.printFontGrid(2, 7, "IGNORE AXIS:" + GeneralUtil.getONorOFF(joyIgnoreAxis), (cursor == 4));
	NormalFontSlick.printFontGrid(2, 8, "IGNORE POV:" + GeneralUtil.getONorOFF(joyIgnorePOV), (cursor == 5));
	NormalFontSlick.printFontGrid(2, 9, "JOYSTICK METHOD:" + JOYSTICK_METHOD_STRINGS[joyMethod], (cursor == 6));

	if(cursor < UI_TEXT.length) NormalFontSlick.printTTFFont(16, 432, NullpoMinoSlick.getUIText(UI_TEXT[cursor]));
}
 
Example 6
@Override
protected void renderImpl(GameContainer container, StateBasedGame game, Graphics g) throws SlickException {
	// Background
	g.drawImage(ResourceHolderSlick.imgMenu, 0, 0);

	// Menu
	NormalFontSlick.printFontGrid(1, 1, (player + 1) + "P AI SETTING", NormalFontSlick.COLOR_ORANGE);

	NormalFontSlick.printFontGrid(1, 3 + cursor, "b", NormalFontSlick.COLOR_RED);

	String aiName = "";
	if(aiID < 0) aiName = "(DISABLE)";
	else aiName = aiNameList[aiID].toUpperCase();
	NormalFontSlick.printFontGrid(2, 3, "AI TYPE:" + aiName, (cursor == 0));
	NormalFontSlick.printFontGrid(2, 4, "AI MOVE DELAY:" + aiMoveDelay, (cursor == 1));
	NormalFontSlick.printFontGrid(2, 5, "AI THINK DELAY:" + aiThinkDelay, (cursor == 2));
	NormalFontSlick.printFontGrid(2, 6, "AI USE THREAD:" + GeneralUtil.getONorOFF(aiUseThread), (cursor == 3));
	NormalFontSlick.printFontGrid(2, 7, "AI SHOW HINT:" + GeneralUtil.getONorOFF(aiShowHint), (cursor == 4));
	NormalFontSlick.printFontGrid(2, 8, "AI PRE-THINK:" + GeneralUtil.getONorOFF(aiPrethink), (cursor == 5));
	NormalFontSlick.printFontGrid(2, 9, "AI SHOW INFO:" + GeneralUtil.getONorOFF(aiShowState), (cursor == 6));

	NormalFontSlick.printFontGrid(1, 28, "A:OK B:CANCEL", NormalFontSlick.COLOR_GREEN);
}
 
Example 7
/**
 * @see org.newdawn.slick.BasicGame#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics)
 */
public void render(GameContainer container, Graphics g) {
	g.drawString("T - TGA Snapshot", 10,50);
	g.drawString("J - JPG Snapshot", 10,70);
	g.drawString("P - PNG Snapshot", 10,90);

	g.setDrawMode(Graphics.MODE_ADD);
	g.drawImage(copy, 200, 300);
	g.setDrawMode(Graphics.MODE_NORMAL);
	
	g.drawString(message, 10,400);
	g.drawRect(200,0,400,300);
	g.translate(400, 250);
	fire.render();
	this.g = g;
}
 
Example 8
/**
 * @see org.newdawn.slick.BasicGame#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics)
 */
public void render(GameContainer container, Graphics g) {
	g.drawString("R - Toggle Rotationg",10,50);
	g.drawImage(image1, 100, 236);
	g.drawImage(image2, 600, 236);
	
	g.translate(0, -150);
	g.rotate(400, 300, ang);
	g.texture(shape, image2);
	g.texture(shape, image1, fill);
	g.resetTransform();
	
	g.translate(0, 150);
	g.rotate(400, 300, ang);
	g.texture(poly, image2);
	g.texture(poly, image1, fill);
	g.resetTransform();
}
 
Example 9
/**
 * @see org.newdawn.slick.BasicGame#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics)
 */
public void render(GameContainer container, Graphics g) throws SlickException {
	g.scale(2,2);
	g.fillRect(0, 0, 800, 600, back, 0, 0);
	g.resetTransform();
	
	g.drawImage(image,100,100);
	image.draw(100,200,80,200);
	
	font.drawString(100,200,"Text Drawn before the callable");
	
	SlickCallable callable = new SlickCallable() {
		protected void performGLOperations() throws SlickException {
			renderGL();
		}
	};
	callable.call();
	
	homer.draw(450,250,80,200);
	font.drawString(150,300,"Text Drawn after the callable");
}
 
Example 10
@Override
protected void renderImpl(GameContainer container, StateBasedGame game, Graphics g) throws SlickException {
	// Background
	g.drawImage(ResourceHolderSlick.imgMenu, 0, 0);

	// Menu
	NormalFontSlick.printFontGrid(1, 1, "SELECT " + (player+1) + "P STYLE", NormalFontSlick.COLOR_ORANGE);

	NormalFontSlick.printFontGrid(1, 3 + cursor, "b", NormalFontSlick.COLOR_RED);

	for(int i = 0; i < GameEngine.MAX_GAMESTYLE; i++) {
		NormalFontSlick.printFontGrid(2, 3 + i, GameEngine.GAMESTYLE_NAMES[i], (cursor == i));
	}
}
 
Example 11
@Override
protected void renderImpl(GameContainer container, StateBasedGame game, Graphics g) throws SlickException {
	g.drawImage(ResourceHolderSlick.imgMenu, 0, 0);

	NormalFontSlick.printFontGrid(1, 1, "KEYBOARD NAVIGATION SETTING (" + (player + 1) + "P)", NormalFontSlick.COLOR_ORANGE);

	NormalFontSlick.printFontGrid(1, 3 + cursor, "b", NormalFontSlick.COLOR_RED);

	NormalFontSlick.printFontGrid(2, 3, "COPY FROM GAME KEYS", (cursor == 0));
	NormalFontSlick.printFontGrid(2, 4, "CUSTOMIZE", (cursor == 1));
}
 
Example 12
/**
 * @see org.newdawn.slick.state.BasicGameState#render(org.newdawn.slick.GameContainer, org.newdawn.slick.state.StateBasedGame, org.newdawn.slick.Graphics)
 */
public void render(GameContainer container, StateBasedGame game, Graphics g) {
	g.setFont(font);
	g.setColor(Color.green);
	g.drawString("This is State 2", 200, 50);
	
	g.rotate(400,300,ang);
	g.drawImage(image,400-(image.getWidth()/2),300-(image.getHeight()/2));
}
 
Example 13
public void render(GameContainer container, Graphics g) throws SlickException {
   g.setColor(Color.white);
   g.drawString("Endianness is " + endian, 10, 100);
   
   g.drawString("Image below should be red", 10, 200);
   g.drawImage(fromRed, 10, 220);
   g.drawString("Image below should be blue", 410, 200);
   g.drawImage(fromBlue, 410, 220);
}
 
Example 14
/**
 * @see org.newdawn.slick.BasicGame#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics)
 */
public void render(GameContainer container, Graphics g) {
	original.draw(0,0,new Color(1,1,1,0.4f));
	
	image.draw(x,y);
	imageX.draw(x+400,y);
	imageY.draw(x,y+300);
	scaledSub.draw(x+300,y+300);
	
	bigSheet.getSprite(7, 5).draw(50,10);
	g.setColor(Color.white);
	g.drawRect(50,10,64,64);
	g.rotate(x+400, y+165, ang);
	g.drawImage(sub, x+300, y+100);
}
 
Example 15
public void render(GameContainer container, StateBasedGame game, Graphics g) throws SlickException {
	if(!container.hasFocus()) {
		if(!NullpoMinoSlick.alternateFPSTiming) NullpoMinoSlick.alternateFPSSleep();
		return;
	}

	g.drawImage(ResourceHolderSlick.imgMenu, 0, 0);

	if(!isNavSetting) {
		NormalFontSlick.printFontGrid(1, 1, "KEYBOARD SETTING (" + (player + 1) + "P)", NormalFontSlick.COLOR_ORANGE);
	} else {
		NormalFontSlick.printFontGrid(1, 1, "KEYBOARD NAVIGATION SETTING (" + (player + 1) + "P)", NormalFontSlick.COLOR_ORANGE);
	}
	if(!NullpoMinoSlick.useJInputKeyboard) {
		NormalFontSlick.printFontGrid(1, 2, "SLICK NATIVE MODE", NormalFontSlick.COLOR_CYAN);
	} else {
		NormalFontSlick.printFontGrid(1, 2, "JINPUT MODE", NormalFontSlick.COLOR_PINK);
	}

	NormalFontSlick.printFontGrid(2,  4, "UP          : " + getKeyName(keymap[GameKeySlick.BUTTON_UP]), (keynum == 0));
	NormalFontSlick.printFontGrid(2,  5, "DOWN        : " + getKeyName(keymap[GameKeySlick.BUTTON_DOWN]), (keynum == 1));
	NormalFontSlick.printFontGrid(2,  6, "LEFT        : " + getKeyName(keymap[GameKeySlick.BUTTON_LEFT]), (keynum == 2));
	NormalFontSlick.printFontGrid(2,  7, "RIGHT       : " + getKeyName(keymap[GameKeySlick.BUTTON_RIGHT]), (keynum == 3));
	if(!isNavSetting) {
		NormalFontSlick.printFontGrid(2,  8, "A (L/R-ROT) : " + getKeyName(keymap[GameKeySlick.BUTTON_A]), (keynum == 4));
		NormalFontSlick.printFontGrid(2,  9, "B (R/L-ROT) : " + getKeyName(keymap[GameKeySlick.BUTTON_B]), (keynum == 5));
		NormalFontSlick.printFontGrid(2, 10, "C (L/R-ROT) : " + getKeyName(keymap[GameKeySlick.BUTTON_C]), (keynum == 6));
		NormalFontSlick.printFontGrid(2, 11, "D (HOLD)    : " + getKeyName(keymap[GameKeySlick.BUTTON_D]), (keynum == 7));
		NormalFontSlick.printFontGrid(2, 12, "E (180-ROT) : " + getKeyName(keymap[GameKeySlick.BUTTON_E]), (keynum == 8));
	} else {
		NormalFontSlick.printFontGrid(2,  8, "A (SELECT)  : " + getKeyName(keymap[GameKeySlick.BUTTON_A]), (keynum == 4));
		NormalFontSlick.printFontGrid(2,  9, "B (CANCEL)  : " + getKeyName(keymap[GameKeySlick.BUTTON_B]), (keynum == 5));
		NormalFontSlick.printFontGrid(2, 10, "C           : " + getKeyName(keymap[GameKeySlick.BUTTON_C]), (keynum == 6));
		NormalFontSlick.printFontGrid(2, 11, "D           : " + getKeyName(keymap[GameKeySlick.BUTTON_D]), (keynum == 7));
		NormalFontSlick.printFontGrid(2, 12, "E           : " + getKeyName(keymap[GameKeySlick.BUTTON_E]), (keynum == 8));
	}
	NormalFontSlick.printFontGrid(2, 13, "F           : " + getKeyName(keymap[GameKeySlick.BUTTON_F]), (keynum == 9));
	NormalFontSlick.printFontGrid(2, 14, "QUIT        : " + getKeyName(keymap[GameKeySlick.BUTTON_QUIT]), (keynum == 10));
	NormalFontSlick.printFontGrid(2, 15, "PAUSE       : " + getKeyName(keymap[GameKeySlick.BUTTON_PAUSE]), (keynum == 11));
	NormalFontSlick.printFontGrid(2, 16, "GIVEUP      : " + getKeyName(keymap[GameKeySlick.BUTTON_GIVEUP]), (keynum == 12));
	NormalFontSlick.printFontGrid(2, 17, "RETRY       : " + getKeyName(keymap[GameKeySlick.BUTTON_RETRY]), (keynum == 13));
	NormalFontSlick.printFontGrid(2, 18, "FRAME STEP  : " + getKeyName(keymap[GameKeySlick.BUTTON_FRAMESTEP]), (keynum == 14));
	NormalFontSlick.printFontGrid(2, 19, "SCREEN SHOT : " + getKeyName(keymap[GameKeySlick.BUTTON_SCREENSHOT]), (keynum == 15));
	NormalFontSlick.printFontGrid(2, 20, "[SAVE & EXIT]", (keynum == 16));

	NormalFontSlick.printFontGrid(1, 4 + keynum, "b", NormalFontSlick.COLOR_RED);

	if(frame >= KEYACCEPTFRAME) {
		if(keyConfigRestFrame > 0) {
			NormalFontSlick.printFontGrid(1, 22, "PUSH KEY... " + GeneralUtil.getTime(keyConfigRestFrame), NormalFontSlick.COLOR_PINK);
		} else if(keynum < NUM_KEYS) {
			NormalFontSlick.printFontGrid(1, 22, "UP/DOWN:   MOVE CURSOR", NormalFontSlick.COLOR_GREEN);
			NormalFontSlick.printFontGrid(1, 23, "ENTER:     SET KEY", NormalFontSlick.COLOR_GREEN);
			NormalFontSlick.printFontGrid(1, 24, "DELETE:    SET TO NONE", NormalFontSlick.COLOR_GREEN);
			NormalFontSlick.printFontGrid(1, 25, "BACKSPACE: CANCEL", NormalFontSlick.COLOR_GREEN);
		} else {
			NormalFontSlick.printFontGrid(1, 22, "UP/DOWN:   MOVE CURSOR", NormalFontSlick.COLOR_GREEN);
			NormalFontSlick.printFontGrid(1, 23, "ENTER:     SAVE & EXIT", NormalFontSlick.COLOR_GREEN);
			NormalFontSlick.printFontGrid(1, 24, "BACKSPACE: CANCEL", NormalFontSlick.COLOR_GREEN);
		}
	}

	// FPS
	NullpoMinoSlick.drawFPS(container);
	// Observer
	NullpoMinoSlick.drawObserverClient();
	if(!NullpoMinoSlick.alternateFPSTiming) NullpoMinoSlick.alternateFPSSleep();
}
 
Example 16
public void render(GameContainer container, StateBasedGame game, Graphics g) throws SlickException {
	if(!container.hasFocus()) {
		if(!NullpoMinoSlick.alternateFPSTiming) NullpoMinoSlick.alternateFPSSleep();
		return;
	}

	g.drawImage(ResourceHolderSlick.imgMenu, 0, 0);

	NormalFontSlick.printFontGrid(1, 1, "JOYSTICK SETTING (" + (player + 1) + "P)", NormalFontSlick.COLOR_ORANGE);

	if(joyNumber < 0)
		NormalFontSlick.printFontGrid(1, 3, "NO JOYSTICK", NormalFontSlick.COLOR_RED);
	else
		NormalFontSlick.printFontGrid(1, 3, "JOYSTICK NUMBER:" + joyNumber, NormalFontSlick.COLOR_RED);

	//NormalFont.printFontGrid(2, 3, "UP             : " + String.valueOf(buttonmap[GameKey.BUTTON_UP]), (keynum == 0));
	//NormalFont.printFontGrid(2, 4, "DOWN           : " + String.valueOf(buttonmap[GameKey.BUTTON_DOWN]), (keynum == 1));
	//NormalFont.printFontGrid(2, 5, "LEFT           : " + String.valueOf(buttonmap[GameKey.BUTTON_LEFT]), (keynum == 2));
	//NormalFont.printFontGrid(2, 6, "RIGHT          : " + String.valueOf(buttonmap[GameKey.BUTTON_RIGHT]), (keynum == 3));
	NormalFontSlick.printFontGrid(2, 5, "A (L/R-ROT)    : " + String.valueOf(buttonmap[GameKeySlick.BUTTON_A]), (keynum == 4));
	NormalFontSlick.printFontGrid(2, 6, "B (R/L-ROT)    : " + String.valueOf(buttonmap[GameKeySlick.BUTTON_B]), (keynum == 5));
	NormalFontSlick.printFontGrid(2, 7, "C (L/R-ROT)    : " + String.valueOf(buttonmap[GameKeySlick.BUTTON_C]), (keynum == 6));
	NormalFontSlick.printFontGrid(2, 8, "D (HOLD)       : " + String.valueOf(buttonmap[GameKeySlick.BUTTON_D]), (keynum == 7));
	NormalFontSlick.printFontGrid(2, 9, "E (180-ROT)    : " + String.valueOf(buttonmap[GameKeySlick.BUTTON_E]), (keynum == 8));
	NormalFontSlick.printFontGrid(2, 10, "F              : " + String.valueOf(buttonmap[GameKeySlick.BUTTON_F]), (keynum == 9));
	NormalFontSlick.printFontGrid(2, 11, "QUIT           : " + String.valueOf(buttonmap[GameKeySlick.BUTTON_QUIT]), (keynum == 10));
	NormalFontSlick.printFontGrid(2, 12, "PAUSE          : " + String.valueOf(buttonmap[GameKeySlick.BUTTON_PAUSE]), (keynum == 11));
	NormalFontSlick.printFontGrid(2, 13, "GIVEUP         : " + String.valueOf(buttonmap[GameKeySlick.BUTTON_GIVEUP]), (keynum == 12));
	NormalFontSlick.printFontGrid(2, 14, "RETRY          : " + String.valueOf(buttonmap[GameKeySlick.BUTTON_RETRY]), (keynum == 13));
	NormalFontSlick.printFontGrid(2, 15, "FRAME STEP     : " + String.valueOf(buttonmap[GameKeySlick.BUTTON_FRAMESTEP]), (keynum == 14));
	NormalFontSlick.printFontGrid(2, 16, "SCREEN SHOT    : " + String.valueOf(buttonmap[GameKeySlick.BUTTON_SCREENSHOT]), (keynum == 15));

	NormalFontSlick.printFontGrid(1, 5 + keynum - 4, "b", NormalFontSlick.COLOR_RED);
	if(frame >= KEYACCEPTFRAME) {
		NormalFontSlick.printFontGrid(1, 20, "UP/DOWN:   MOVE CURSOR", NormalFontSlick.COLOR_GREEN);
		NormalFontSlick.printFontGrid(1, 21, "ENTER:     OK",     NormalFontSlick.COLOR_GREEN);
		NormalFontSlick.printFontGrid(1, 22, "DELETE:    NO SET", NormalFontSlick.COLOR_GREEN);
		NormalFontSlick.printFontGrid(1, 23, "BACKSPACE: CANCEL", NormalFontSlick.COLOR_GREEN);
	}

	// FPS
	NullpoMinoSlick.drawFPS(container);
	// Observer
	NullpoMinoSlick.drawObserverClient();
	if(!NullpoMinoSlick.alternateFPSTiming) NullpoMinoSlick.alternateFPSSleep();
}
 
Example 17
@Override
protected void renderImpl(GameContainer container, StateBasedGame game, Graphics g) throws SlickException {
	g.drawImage(ResourceHolderSlick.imgMenu, 0, 0);

	if(isPreview) {
		// Preview
		try {
			String strButtonF = gameManager.receiver.getKeyNameByButtonID(gameManager.engine[0], Controller.BUTTON_F);
			int fontY = (gameManager.receiver.getNextDisplayType() == 2) ? 1 : 27;
			NormalFontSlick.printFontGrid(1, fontY, "PUSH F BUTTON (" + strButtonF.toUpperCase() + " KEY) TO EXIT", NormalFontSlick.COLOR_YELLOW);

			gameManager.renderAll();
		} catch (Exception e) {
			log.error("Render fail", e);
		}
	} else {
		// Menu
		String strTemp = "";

		NormalFontSlick.printFontGrid(1, 1, "GAME TUNING (" + (player+1) + "P)", NormalFontSlick.COLOR_ORANGE);
		NormalFontSlick.printFontGrid(1, 3 + cursor, "b", NormalFontSlick.COLOR_RED);

		if(owRotateButtonDefaultRight == -1) strTemp = "AUTO";
		if(owRotateButtonDefaultRight == 0) strTemp = "LEFT";
		if(owRotateButtonDefaultRight == 1) strTemp = "RIGHT";
		NormalFontSlick.printFontGrid(2, 3, "A BUTTON ROTATE:" + strTemp, (cursor == 0));

		NormalFontSlick.printFontGrid(2, 4, "BLOCK SKIN:" + ((owSkin == -1) ? "AUTO": String.valueOf(owSkin)), (cursor == 1));
		if((owSkin >= 0) && (owSkin < ResourceHolderSlick.imgNormalBlockList.size())) {
			//ResourceHolder.imgBlock.draw(256, 64, 256 + 144, 64 + 16, 0, owSkin * 16, 144, (owSkin * 16) + 16);
			Image imgBlock = ResourceHolderSlick.imgNormalBlockList.get(owSkin);

			if(ResourceHolderSlick.blockStickyFlagList.get(owSkin) == true) {
				for(int j = 0; j < 9; j++) {
					imgBlock.draw(256 + (j * 16), 64, 256 + (j * 16) + 16, 64 + 16, 0, (j * 16), 16, (j * 16) + 16);
				}
			} else {
				imgBlock.draw(256, 64, 256+144, 64+16, 0, 0, 144, 16);
			}
		}

		NormalFontSlick.printFontGrid(2, 5, "MIN DAS:" + ((owMinDAS == -1) ? "AUTO" : String.valueOf(owMinDAS)), (cursor == 2));
		NormalFontSlick.printFontGrid(2, 6, "MAX DAS:" + ((owMaxDAS == -1) ? "AUTO" : String.valueOf(owMaxDAS)), (cursor == 3));
		NormalFontSlick.printFontGrid(2, 7, "DAS DELAY:" + ((owDasDelay == -1) ? "AUTO" : String.valueOf(owDasDelay)), (cursor == 4));
		NormalFontSlick.printFontGrid(2, 8, "REVERSE UP/DOWN:" + GeneralUtil.getOorX(owReverseUpDown), (cursor == 5));

		if(owMoveDiagonal == -1) strTemp = "AUTO";
		if(owMoveDiagonal == 0) strTemp = "e";
		if(owMoveDiagonal == 1) strTemp = "c";
		NormalFontSlick.printFontGrid(2, 9, "DIAGONAL MOVE:" + strTemp, (cursor == 6));

		NormalFontSlick.printFontGrid(2, 10, "OUTLINE TYPE:" + OUTLINE_TYPE_NAMES[owBlockOutlineType + 1], (cursor == 7));

		if(owBlockShowOutlineOnly == -1) strTemp = "AUTO";
		if(owBlockShowOutlineOnly == 0) strTemp = "e";
		if(owBlockShowOutlineOnly == 1) strTemp = "c";
		NormalFontSlick.printFontGrid(2, 11, "SHOW OUTLINE ONLY:" + strTemp, (cursor == 8));

		NormalFontSlick.printFontGrid(2, 12, "[PREVIEW]", (cursor == 9));

		if((cursor >= 0) && (cursor < UI_TEXT.length)) NormalFontSlick.printTTFFont(16, 432, NullpoMinoSlick.getUIText(UI_TEXT[cursor]));
	}
}
 
Example 18
@Override
protected void renderImpl(GameContainer container, StateBasedGame game, Graphics g) throws SlickException {
	// Background
	g.drawImage(ResourceHolderSlick.imgMenu, 0, 0);

	// Basic Options
	if(cursor < 17) {
		NormalFontSlick.printFontGrid(1, 1, "GENERAL OPTIONS: BASIC (1/3)", NormalFontSlick.COLOR_ORANGE);
		NormalFontSlick.printFontGrid(1, 3 + cursor, "b", NormalFontSlick.COLOR_RED);

		NormalFontSlick.printFontGrid(2,  3, "SE:" + GeneralUtil.getOorX(se), (cursor == 0));
		NormalFontSlick.printFontGrid(2,  4, "BGM:" + GeneralUtil.getOorX(bgm), (cursor == 1));
		NormalFontSlick.printFontGrid(2,  5, "BGM PRELOAD:" + GeneralUtil.getOorX(bgmpreload), (cursor == 2));
		NormalFontSlick.printFontGrid(2,  6, "SE VOLUME:" + sevolume + "("+ (sevolume * 100 / 128) + "%)", (cursor == 3));
		NormalFontSlick.printFontGrid(2,  7, "BGM VOLUME:" + bgmvolume + "(" + (bgmvolume * 100 / 128) + "%)", (cursor == 4));
		NormalFontSlick.printFontGrid(2,  8, "SHOW BACKGROUND:" + GeneralUtil.getOorX(showbg), (cursor == 5));
		NormalFontSlick.printFontGrid(2,  9, "USE BACKGROUND FADE:" + GeneralUtil.getOorX(heavyeffect), (cursor == 6));
		NormalFontSlick.printFontGrid(2, 10, "SHOW LINE EFFECT:" + GeneralUtil.getOorX(showlineeffect), (cursor == 7));
		NormalFontSlick.printFontGrid(2, 11, "LINE EFFECT SPEED:" + "X " + (lineeffectspeed+1), (cursor == 8));
		NormalFontSlick.printFontGrid(2, 12, "SHOW METER:" + GeneralUtil.getOorX(showmeter), (cursor == 9));
		NormalFontSlick.printFontGrid(2, 13, "DARK NEXT AREA:" + GeneralUtil.getOorX(darknextarea), (cursor == 10));
		NormalFontSlick.printFontGrid(2, 14, "SHOW NEXT ABOVE SHADOW:" + GeneralUtil.getOorX(nextshadow), (cursor == 11));
		NormalFontSlick.printFontGrid(2, 15, "NEXT DISPLAY TYPE:" + NEXTTYPE_OPTIONS[nexttype], (cursor == 12));
		NormalFontSlick.printFontGrid(2, 16, "OUTLINE GHOST PIECE:" + GeneralUtil.getOorX(outlineghost), (cursor == 13));
		NormalFontSlick.printFontGrid(2, 17, "FIELD BG BRIGHT:" + fieldbgbright + "(" + (fieldbgbright * 100 / 255) + "%)", (cursor == 14));
		NormalFontSlick.printFontGrid(2, 18, "SHOW FIELD BG GRID:" + GeneralUtil.getOorX(showfieldbggrid), (cursor == 15));
		NormalFontSlick.printFontGrid(2, 19, "SHOW CONTROLLER INPUT:" + GeneralUtil.getOorX(showInput), (cursor == 16));
	}
	// Advanced Options
	else if(cursor < 23) {
		NormalFontSlick.printFontGrid(1, 1, "GENERAL OPTIONS: ADVANCED (2/3)", NormalFontSlick.COLOR_ORANGE);
		NormalFontSlick.printFontGrid(1, 3 + (cursor - 17), "b", NormalFontSlick.COLOR_RED);

		NormalFontSlick.printFontGrid(2,  3, "FULLSCREEN:" + GeneralUtil.getOorX(fullscreen), (cursor == 17));
		NormalFontSlick.printFontGrid(2,  4, "SHOW FPS:" + GeneralUtil.getOorX(showfps), (cursor == 18));
		NormalFontSlick.printFontGrid(2,  5, "MAX FPS:" + maxfps, (cursor == 19));
		NormalFontSlick.printFontGrid(2,  6, "FRAME STEP:" + GeneralUtil.getOorX(enableframestep), (cursor == 20));
		NormalFontSlick.printFontGrid(2,  7, "FPS PERFECT MODE:" + GeneralUtil.getOorX(alternateFPSPerfectMode), (cursor == 21));
		NormalFontSlick.printFontGrid(2,  8, "FPS PERFECT YIELD:" + GeneralUtil.getOorX(alternateFPSPerfectYield), (cursor == 22));
	}
	// Slick Options
	else {
		NormalFontSlick.printFontGrid(1, 1, "GENERAL OPTIONS: SLICK (3/3)", NormalFontSlick.COLOR_ORANGE);
		NormalFontSlick.printFontGrid(1, 3 + (cursor - 23), "b", NormalFontSlick.COLOR_RED);

		NormalFontSlick.printFontGrid(2,  3, "BGM STREAMING:" + GeneralUtil.getOorX(bgmstreaming), (cursor == 23));
		NormalFontSlick.printFontGrid(2,  4, "VSYNC:" + GeneralUtil.getOorX(vsync), (cursor == 24));
		NormalFontSlick.printFontGrid(2,  5, "FPS SLEEP TIMING:" + (alternateFPSTiming ? "UPDATE" : "RENDER"), (cursor == 25));
		NormalFontSlick.printFontGrid(2,  6, "FPS DYNAMIC ADJUST:" + GeneralUtil.getOorX(alternateFPSDynamicAdjust), (cursor == 26));
		NormalFontSlick.printFontGrid(2,  7, "SCREEN SIZE:" + SCREENSIZE_TABLE[screenSizeType][0] + "e" + SCREENSIZE_TABLE[screenSizeType][1],
								 (cursor == 27));
	}

	if((cursor >= 0) && (cursor < UI_TEXT.length)) NormalFontSlick.printTTFFont(16, 432, NullpoMinoSlick.getUIText(UI_TEXT[cursor]));
}
 
Example 19
/**
 * @see org.newdawn.slick.BasicGame#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics)
 */
public void render(GameContainer container, Graphics g) throws SlickException {
	g.setColor(Color.white);
	
	g.setAntiAlias(true);
	for (int x=0;x<360;x+=10) {
		g.drawLine(700,100,(int) (700+(Math.cos(Math.toRadians(x))*100)),
						   (int) (100+(Math.sin(Math.toRadians(x))*100)));
	}
	g.setAntiAlias(false);
	
	g.setColor(Color.yellow);
	g.drawString("The Graphics Test!", 300, 50);
	g.setColor(Color.white);
	g.drawString("Space - Toggles clipping", 400, 80);
	g.drawString("Frame rate capped to 100", 400, 120);
	
	if (clip) {
		g.setColor(Color.gray);
		g.drawRect(100,260,400,100);
		g.setClip(100,260,400,100);
	}

	g.setColor(Color.yellow);
	g.translate(100, 120);
	g.fill(poly);
	g.setColor(Color.blue);
	g.setLineWidth(3);
	g.draw(poly);
	g.setLineWidth(1);
	g.translate(0, 230);
	g.draw(poly);
	g.resetTransform();
	
	g.setColor(Color.magenta);
	g.drawRoundRect(10, 10, 100, 100, 10);
	g.fillRoundRect(10, 210, 100, 100, 10);
	
	g.rotate(400, 300, ang);
	g.setColor(Color.green);
	g.drawRect(200,200,200,200);
	g.setColor(Color.blue);
	g.fillRect(250,250,100,100);

	g.drawImage(image, 300,270);
	
	g.setColor(Color.red);
	g.drawOval(100,100,200,200);
	g.setColor(Color.red.darker());
	g.fillOval(300,300,150,100);
	g.setAntiAlias(true);
	g.setColor(Color.white);
	g.setLineWidth(5.0f);
	g.drawOval(300,300,150,100);
	g.setAntiAlias(true);
	g.resetTransform();
	
	if (clip) {
		g.clearClip();
	}
}