本文整理汇总了Java中org.newdawn.slick.Graphics.pushTransform方法的典型用法代码示例。如果您正苦于以下问题:Java Graphics.pushTransform方法的具体用法?Java Graphics.pushTransform怎么用?Java Graphics.pushTransform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.newdawn.slick.Graphics
的用法示例。
在下文中一共展示了Graphics.pushTransform方法的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) {
g.setColor(Color.white);
g.drawString("Red indicates a collision, green indicates no collision", 50, 420);
g.drawString("White are the targets", 50, 435);
g.pushTransform();
g.translate(100,100);
g.pushTransform();
g.translate(-50,-50);
g.scale(10, 10);
g.setColor(Color.red);
g.fillRect(0,0,5,5);
g.setColor(Color.white);
g.drawRect(0,0,5,5);
g.popTransform();
g.setColor(Color.green);
g.fillRect(20,20,50,50);
g.popTransform();
g.setColor(Color.white);
g.draw(rect);
g.draw(circle);
g.setColor(rect1.intersects(rect) ? Color.red : Color.green);
g.draw(rect1);
g.setColor(rect2.intersects(rect) ? Color.red : Color.green);
g.draw(rect2);
g.setColor(roundRect.intersects(rect) ? Color.red : Color.green);
g.draw(roundRect);
g.setColor(circle1.intersects(rect) ? Color.red : Color.green);
g.draw(circle1);
g.setColor(circle2.intersects(rect) ? Color.red : Color.green);
g.draw(circle2);
g.setColor(circle3.intersects(circle) ? Color.red : Color.green);
g.fill(circle3);
g.setColor(circle4.intersects(circle) ? Color.red : Color.green);
g.draw(circle4);
g.fill(roundRect2);
g.setColor(Color.blue);
g.draw(roundRect2);
g.setColor(Color.blue);
g.draw(new Circle(100,100,50));
g.drawRect(50,50,100,100);
}