本文整理匯總了Java中org.newdawn.slick.Graphics.drawRoundRect方法的典型用法代碼示例。如果您正苦於以下問題:Java Graphics.drawRoundRect方法的具體用法?Java Graphics.drawRoundRect怎麽用?Java Graphics.drawRoundRect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.newdawn.slick.Graphics
的用法示例。
在下文中一共展示了Graphics.drawRoundRect方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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();
}
}