本文整理汇总了Java中org.newdawn.slick.Graphics.scale方法的典型用法代码示例。如果您正苦于以下问题:Java Graphics.scale方法的具体用法?Java Graphics.scale怎么用?Java Graphics.scale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.newdawn.slick.Graphics
的用法示例。
在下文中一共展示了Graphics.scale方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: preRender
import org.newdawn.slick.Graphics; //导入方法依赖的package包/类
/**
* @see org.newdawn.slick.state.transition.Transition#preRender(org.newdawn.slick.state.StateBasedGame, org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics)
*/
public void preRender(StateBasedGame game, GameContainer container,
Graphics g) throws SlickException {
if (moveBackDone) {
g.translate(xp1,yp1);
g.scale(scale1, scale1);
g.setClip((int) xp1,(int) yp1,(int) (scale1*container.getWidth()),(int) (scale1*container.getHeight()));
prev.render(container, game, g);
g.resetTransform();
g.clearClip();
}
g.translate(xp2,yp2);
g.scale(scale2, scale2);
g.setClip((int) xp2,(int) yp2,(int) (scale2*container.getWidth()),(int) (scale2*container.getHeight()));
}
示例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 contiainer, Graphics g) {
g.translate(320,240);
g.scale(scale, scale);
g.setColor(Color.red);
for (int x=0;x<10;x++) {
for (int y=0;y<10;y++) {
g.fillRect(-500+(x*100), -500+(y*100), 80, 80);
}
}
g.setColor(new Color(1,1,1,0.5f));
g.fillRect(-320,-240,640,480);
g.setColor(Color.white);
g.drawRect(-320,-240,640,480);
}
示例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.scale(zoom,zoom);
g.translate(x, y);
g.scale(0.3f,0.3f);
//renderer[0].render(g);
g.scale(1/0.3f,1/0.3f);
g.translate(400, 0);
//renderer[1].render(g);
g.translate(100, 300);
g.scale(0.7f,0.7f);
//renderer[2].render(g);
g.scale(1/0.7f,1/0.7f);
g.scale(0.5f,0.5f);
g.translate(-1100, -380);
renderer[3].render(g);
g.scale(1/0.5f,1/0.5f);
// g.translate(280, 100);
// g.scale(0.5f,0.5f);
// renderer[4].render(g);
g.resetTransform();
}
示例4: 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 contiainer, Graphics g) {
g.translate(320,240);
g.translate( -camX * scale, -camY * scale);
g.scale(scale, scale);
g.setColor(Color.red);
for (int x=0;x<10;x++) {
for (int y=0;y<10;y++) {
g.fillRect(-500+(x*100), -500+(y*100), 80, 80);
}
}
g.setColor(new Color(1,1,1,0.5f));
g.fillRect(-320,-240,640,480);
g.setColor(Color.white);
g.drawRect(-320,-240,640,480);
}
示例5: 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.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");
}
示例6: 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("Space to restart() animation", 100, 50);
g.drawString("Til Limited animation: "+start, 100, 500);
g.drawString("Hold 1 to move the manually animated", 100, 70);
g.drawString("PingPong Frame:"+pingPong.getFrame(), 600, 70);
g.scale(-1,1);
animation.draw(-100,100);
animation.draw(-200,100,36*4,65*4);
if (start < 0) {
limited.draw(-400,100,36*4,65*4);
}
manual.draw(-600,100,36*4,65*4);
pingPong.draw(-700,100,36*2,65*2);
}
示例7: 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) {
image.draw(0,0);
image.draw(500,0,200,100);
scaleMe.draw(500,100,200,100);
scaled.draw(400,500);
Image flipped = scaled.getFlippedCopy(true, false);
flipped.draw(520,500);
Image flipped2 = flipped.getFlippedCopy(false, true);
flipped2.draw(520,380);
Image flipped3 = flipped2.getFlippedCopy(true, false);
flipped3.draw(400,380);
for (int i=0;i<3;i++) {
subImage.draw(200+(i*30),300);
}
g.translate(500, 200);
g.rotate(50, 50, rot);
g.scale(0.3f,0.3f);
image.draw();
g.resetTransform();
}
示例8: postRender
import org.newdawn.slick.Graphics; //导入方法依赖的package包/类
/**
* @see org.newdawn.slick.state.transition.Transition#postRender(org.newdawn.slick.state.StateBasedGame, org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics)
*/
public void postRender(StateBasedGame game, GameContainer container, Graphics g) throws SlickException {
g.resetTransform();
if (!moveBackDone) {
g.translate(xp1,yp1);
g.scale(scale1, scale1);
g.setClip((int) xp1,(int) yp1,(int) (scale1*container.getWidth()),(int) (scale1*container.getHeight()));
prev.render(container, game, g);
g.resetTransform();
g.clearClip();
}
}
示例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) {
rocket.draw((int) r,100);
runner.draw(250,250);
g.scale(1.2f,1.2f);
runner.draw(250,250);
g.scale(1.2f,1.2f);
runner.draw(250,250);
g.resetTransform();
g.rotate(670, 470, ang);
sheet.getSprite("floppy").draw(600,400);
}
示例10: 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) {
map.render(10, 10, 4,4,15,15);
g.scale(0.35f,0.35f);
map.render(1400, 0);
g.resetTransform();
g.drawString("map name: " + mapName, 10, 500);
g.drawString("monster difficulty: " + monsterDifficulty, 10, 550);
g.drawString("non existing map property: " + nonExistingMapProperty, 10, 525);
g.drawString("non existing layer property: " + nonExistingLayerProperty, 10, 575);
}
示例11: 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 {
String text = "abc";
font.drawString(610,100,text);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glAlphaFunc(GL11.GL_GEQUAL, 0.5f);
font.drawString(610,150,text);
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_BLEND);
g.translate(-50,-130);
g.scale(10,10);
font.drawString(0,0,text);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glAlphaFunc(GL11.GL_GEQUAL, 0.5f);
font.drawString(0,26,text);
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_BLEND);
g.resetTransform();
g.setColor(Color.lightGray);
g.drawString("Original Size on Sheet", 620, 210);
g.drawString("10x Scale Up", 40, 575);
g.setColor(Color.darkGray);
g.drawRect(40, 40, 560,530);
g.drawRect(610, 105, 150,100);
g.setColor(Color.white);
g.drawString("512x512 Font Sheet", 620, 300);
g.drawString("NEHE Charset", 620, 320);
g.drawString("4096x4096 (8x) Source Image", 620, 340);
g.drawString("ScanSize = 20", 620, 360);
}
示例12: 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);
}