本文整理匯總了Java中org.newdawn.slick.Image.setFilter方法的典型用法代碼示例。如果您正苦於以下問題:Java Image.setFilter方法的具體用法?Java Image.setFilter怎麽用?Java Image.setFilter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.newdawn.slick.Image
的用法示例。
在下文中一共展示了Image.setFilter方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
import org.newdawn.slick.Image; //導入方法依賴的package包/類
@Override
public void init(GameContainer gc, StateBasedGame sbg) throws SlickException {
mainMenu = new Music("res/menu.ogg");
click = new Sound("res/menuclick.ogg");
title = new Image("res/title.png");
title.setFilter(Image.FILTER_NEAREST);
}
示例2: init
import org.newdawn.slick.Image; //導入方法依賴的package包/類
@Override
public void init(GameContainer arg0, StateBasedGame arg1) throws SlickException {
player = new Player();
buildings = new ArrayList<>();
goons = new ArrayList<>();
bullets = new ArrayList<>();
playerImage = new Image("res/player.png");
playerImage.setFilter(Image.FILTER_NEAREST);
playerJump = new Image("res/playerjump.png");
playerJump.setFilter(Image.FILTER_NEAREST);
cannonImage = new Image("res/cannon.png");
cannonImage.setFilter(Image.FILTER_LINEAR);
cannonImage.setCenterOfRotation(Player.CANNON_CENTER_X, Player.CANNON_CENTER_Y);
SpriteSheet playerSS = new SpriteSheet("res/player_run.png", 60, 75);
playerRunRight = new Animation(playerSS, RUN_ANIMATION_SPEED);
playerRunLeft = new Animation();
int ssw = playerSS.getHorizontalCount(), ssh = playerSS.getVerticalCount();
for (int y = 0; y < ssh; y++) {
for (int x = 0; x < ssw; x++) {
playerRunLeft.addFrame(playerSS.getSprite(x, y).getFlippedCopy(true, false), RUN_ANIMATION_SPEED);
}
}
bulletAnim = new Animation(new SpriteSheet("res/bullet.png", 30, 30), BULLET_ANIMATION_SPEED);
buildingTexture = new Image("res/building.png");
buildingLastRow = buildingTexture.getSubImage(0, buildingTexture.getHeight() - 1, buildingTexture.getWidth(), 1);
buildingTexture.setFilter(Image.FILTER_NEAREST);
buildingLastRow.setFilter(Image.FILTER_NEAREST);
graffitiImages = new Image[NUM_GRAFFITI * 2];
for (int i = 0; i < NUM_GRAFFITI; i++) {
graffitiImages[i] = new Image("res/graffiti" + i + ".png");
graffitiImages[i + NUM_GRAFFITI] = graffitiImages[i].getFlippedCopy(true, false);
}
graffiti = new ArrayList<>();
mainTheme = new Music("res/main.ogg");
try {
partsys = ParticleIO.loadConfiguredSystem("res/particle.xml");
} catch (IOException e) {
e.printStackTrace();
}
fireExplosion = (ConfigurableEmitter)partsys.getEmitter(0);
blueExplosion = (ConfigurableEmitter)partsys.getEmitter(1);
fireExplosion.setEnabled(false);
blueExplosion.setEnabled(false);
fireCannon = new Sound("res/firecannon.ogg");
highExplosion = new Sound("res/highexplosion.ogg");
softExplosion = new Sound("res/softexplosion.ogg");
hurtSound = new Sound("res/hurt.ogg");
basicGoon = new Image("res/plasticbag.png");
strongGoon = new Image("res/trashbag.png");
flyingGoon = new Animation(new SpriteSheet("res/tshirt.png", 50, 50), 200);
background = new Image("res/sunset.png");
background.setFilter(Image.FILTER_NEAREST);
camx = 0;
camy = 0;
camvx = 0;
}