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

The following examples show how to use org.newdawn.slick.Graphics#fillOval() . 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: InputTest.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
/**
 * @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);
}
 
Example 2
Source File: AntiAliasTest.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * @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);
}
 
Example 3
Source File: GeomAccuracyTest.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Draws ovals
 * @param g
 */
void ovalTest(Graphics g) {

	g.setColor(geomColor);
	g.drawOval(100, 100, 99, 99);
	g.fillOval(100, 250, 99, 99);
	
	//Circle circ = new Circle(400, 100, 99);
	Ellipse elip = new Ellipse(449, 149, 49, 49);
	g.draw(elip);
	elip = new Ellipse(449, 299, 49, 49);
	g.fill(elip);
	
	if(hideOverlay == false) {
		g.setColor(overlayColor);
		g.drawLine(100, 149, 198, 149);
		g.drawLine(149, 100, 149, 198);
		
		g.drawLine(100, 149 + 150, 198, 149 + 150);
		g.drawLine(149, 100 + 150, 149, 198 + 150);
		
		g.drawLine(100 + 300, 149, 198 + 300, 149);
		g.drawLine(149 + 300, 100, 149 + 300, 198);			
		
		g.drawLine(100 + 300, 149 + 150, 198 + 300, 149 + 150);
		g.drawLine(149 + 300, 100 + 150, 149 + 300, 198 + 150);			
	}
	

}
 
Example 4
Source File: ScalableTest.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * @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);
}
 
Example 5
Source File: PolygonTest.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * @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);
}
 
Example 6
Source File: ClipTest.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * @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();
}
 
Example 7
Source File: CopyAreaAlphaTest.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * @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);
}
 
Example 8
Source File: GraphicsTest.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
/**
 * @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();
	}
}
 
Example 9
Source File: BlobbyTransition.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 2 votes vote down vote up
/**
 * 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);
}