當前位置: 首頁>>代碼示例>>Java>>正文


Java Graphics.fillOval方法代碼示例

本文整理匯總了Java中org.newdawn.slick.Graphics.fillOval方法的典型用法代碼示例。如果您正苦於以下問題:Java Graphics.fillOval方法的具體用法?Java Graphics.fillOval怎麽用?Java Graphics.fillOval使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.newdawn.slick.Graphics的用法示例。


在下文中一共展示了Graphics.fillOval方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: render

import org.newdawn.slick.Graphics; //導入方法依賴的package包/類
@Override
public void render(Graphics g, long cTime) {
	// Render all the player's active weapons.
	getActiveWeapons().stream().forEach(w -> w.render(g, cTime));
	
	Image image = getImage();
	if(image != null) {
		g.rotate(position.x, position.y, (float)Math.toDegrees(theta));
		g.drawImage(image, (position.x - (image.getWidth() / 2)), 
						   (position.y - (image.getHeight() / 2)));
		g.resetTransform();
	} else {
		// Draw a shape to represent the missing player image.
		g.setColor(Color.red);
		g.fillOval((position.x - 20), (position.y - 20), 40, 40);
	}
}
 
開發者ID:packetpirate,項目名稱:Generic-Zombie-Shooter-Redux,代碼行數:18,代碼來源:Player.java

示例2: render

import org.newdawn.slick.Graphics; //導入方法依賴的package包/類
/**
 * @see org.newdawn.slick.BasicGame#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics)
 */
public void render(GameContainer container, Graphics g) {
       g.drawString("left shift down: "+lshift, 100, 240);
       g.drawString("right shift down: "+rshift, 100, 260);
       g.drawString("space down: "+space, 100, 280); 
       
	g.setColor(Color.white);
	g.drawString(message, 10, 50);
	g.drawString(""+container.getInput().getMouseY(), 10, 400);
	g.drawString("Use the primary gamepad to control the blob, and hit a gamepad button to change the color", 10, 90);

	for (int i=0;i<lines.size();i++) {
		Line line = (Line) lines.get(i);
		line.draw(g);
	}
	
	g.setColor(cols[index]);
	g.fillOval((int) x, (int) y, 50, 50);
	g.setColor(Color.yellow);
	g.fillRect(50,200+ypos,40,40);
}
 
開發者ID:IngSW-unipv,項目名稱:Progetto-C,代碼行數:24,代碼來源:InputTest.java

示例3: render

import org.newdawn.slick.Graphics; //導入方法依賴的package包/類
/**
 * @see org.newdawn.slick.Game#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics)
 */
public void render(GameContainer container, Graphics g) throws SlickException {
	g.setAntiAlias(true);
	g.setColor(Color.red);
	g.drawOval(100,100,100,100);
	g.fillOval(300,100,100,100);
	g.setAntiAlias(false);
	g.setColor(Color.red);
	g.drawOval(100,300,100,100);
	g.fillOval(300,300,100,100);
}
 
開發者ID:j-dong,項目名稱:trashjam2017,代碼行數:14,代碼來源:AntiAliasTest.java

示例4: render

import org.newdawn.slick.Graphics; //導入方法依賴的package包/類
/**
 * @see org.newdawn.slick.Game#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics)
 */
public void render(GameContainer container, Graphics g) throws SlickException {
	g.setColor(new Color(0.4f,0.6f,0.8f));
	g.fillRect(0,0, 1024,568);
	g.setColor(Color.white);
	g.drawRect(5,5, 1024-10,568-10);
	
	g.setColor(Color.white);
	g.drawString(container.getInput().getMouseX()+","+container.getInput().getMouseY(), 10, 400);
	g.setColor(Color.red);
	g.fillOval(container.getInput().getMouseX()-10,container.getInput().getMouseY()-10,20,20);
}
 
開發者ID:j-dong,項目名稱:trashjam2017,代碼行數:15,代碼來源:ScalableTest.java

示例5: render

import org.newdawn.slick.Graphics; //導入方法依賴的package包/類
/**
 * @see org.newdawn.slick.Game#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics)
 */
public void render(GameContainer container, Graphics g)
		throws SlickException {
	g.setColor(Color.white);
	g.drawString("1 - No Clipping", 100, 10);
	g.drawString("2 - Screen Clipping", 100, 30);
	g.drawString("3 - World Clipping", 100, 50);
	
	if (world) {
		g.drawString("WORLD CLIPPING ENABLED", 200, 80);
	} 
	if (clip) {
		g.drawString("SCREEN CLIPPING ENABLED", 200, 80);
	}
	
	g.rotate(400, 400, ang);
	if (world) {
		g.setWorldClip(350,302,100,196);
	}
	if (clip) {
		g.setClip(350,302,100,196);
	}
	g.setColor(Color.red);
	g.fillOval(300,300,200,200);
	g.setColor(Color.blue);
	g.fillRect(390,200,20,400);
	
	g.clearClip();
	g.clearWorldClip();
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:33,代碼來源:ClipTest.java

示例6: render

import org.newdawn.slick.Graphics; //導入方法依賴的package包/類
@Override
public void render(GameContainer container, Graphics g) throws SlickException {
	this.map.render(0, 0, 3);
	this.map.render(0, 0, 0);
	g.setColor(new Color(0, 0, 0, .5f));
	g.fillOval((int) x - 16, (int) y - 8, 32, 16);
	g.drawAnimation(animations[direction + (moving ? 4 : 0)], (int) x - 32, (int) y - 60);
	this.map.render(0, 0, 1);
	this.map.render(0, 0, 2);
	nameInput.render(container, g);
}
 
開發者ID:EnzoMolion,項目名稱:Projet-PLA,代碼行數:12,代碼來源:WindowGame.java

示例7: render

import org.newdawn.slick.Graphics; //導入方法依賴的package包/類
/**
 * @see org.newdawn.slick.Game#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics)
 */
public void render(GameContainer container, Graphics g) throws SlickException {
	if (in) {
		g.setColor(Color.red);
		g.fill(poly);
	}
	g.setColor(Color.yellow);
	g.fillOval(poly.getCenterX()-3, poly.getCenterY()-3, 6, 6);
	g.setColor(Color.white);
	g.draw(poly);
}
 
開發者ID:IngSW-unipv,項目名稱:Progetto-C,代碼行數:14,代碼來源:PolygonTest.java

示例8: render

import org.newdawn.slick.Graphics; //導入方法依賴的package包/類
/**
 * @see org.newdawn.slick.Game#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics)
 */
public void render(GameContainer container, Graphics g)
		throws SlickException {
	g.clearAlphaMap();
	g.setDrawMode(Graphics.MODE_NORMAL);
	g.setColor(Color.white);
	g.fillOval(100,100,150,150);
	textureMap.draw(10,50);
	
	g.copyArea(copy, 100,100);
	g.setColor(Color.red);
	g.fillRect(300,100,200,200);
	copy.draw(350,150);
}
 
開發者ID:IngSW-unipv,項目名稱:Progetto-C,代碼行數:17,代碼來源:CopyAreaAlphaTest.java

示例9: render

import org.newdawn.slick.Graphics; //導入方法依賴的package包/類
/**
 * @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();
	}
}
 
開發者ID:j-dong,項目名稱:trashjam2017,代碼行數:64,代碼來源:GraphicsTest.java

示例10: render

import org.newdawn.slick.Graphics; //導入方法依賴的package包/類
/**
 * Render the blob - i.e. the mask
 * 
 * @param g The grphics context on which the mask should be drawn
 */
public void render(Graphics g) {
	g.fillOval(x-rad,y-rad,rad*2,rad*2);
}
 
開發者ID:j-dong,項目名稱:trashjam2017,代碼行數:9,代碼來源:BlobbyTransition.java


注:本文中的org.newdawn.slick.Graphics.fillOval方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。