本文整理汇总了Java中com.watabou.noosa.Image类的典型用法代码示例。如果您正苦于以下问题:Java Image类的具体用法?Java Image怎么用?Java Image使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Image类属于com.watabou.noosa包,在下文中一共展示了Image类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createChildren
import com.watabou.noosa.Image; //导入依赖的package包/类
@Override
protected void createChildren() {
super.createChildren();
shield = new ItemSprite(ItemSpriteSheet.TOMB, null);
add(shield);
position = new BitmapText(PixelScene.font1x);
position.alpha(0.8f);
add(position);
desc = renderMultiline(7);
add(desc);
depth = new BitmapText(PixelScene.font1x);
depth.alpha(0.8f);
steps = new Image();
classIcon = new Image();
add(classIcon);
level = new BitmapText(PixelScene.font1x);
level.alpha(0.8f);
}
示例2: discover
import com.watabou.noosa.Image; //导入依赖的package包/类
public void discover(int pos, int oldValue) {
final Image tile = tile(oldValue);
tile.point(tileToWorld(pos));
// For bright mode
tile.rm = tile.gm = tile.bm = rm;
tile.ra = tile.ga = tile.ba = ra;
parent.add(tile);
parent.add(new AlphaTweener(tile, 0, 0.6f) {
@Override
protected void onComplete() {
tile.killAndErase();
killAndErase();
}
});
}
示例3: icon
import com.watabou.noosa.Image; //导入依赖的package包/类
private Image icon() {
if (bag instanceof SeedPouch) {
return Icons.get(Icons.SEED_POUCH);
} else if (bag instanceof ScrollHolder) {
return Icons.get(Icons.SCROLL_HOLDER);
} else if (bag instanceof WandHolster) {
return Icons.get(Icons.WAND_HOLSTER);
} else if (bag instanceof PotionBandolier) {
return Icons.get(Icons.POTION_BANDOLIER);
} else if (bag instanceof AnkhChain) {
return Icons.get(Icons.ANKH_CHAIN);
} else if (bag instanceof KeyRing) {
return Icons.get(Icons.KEYRING);
} else {
return Icons.get(Icons.BACKPACK);
}
}
示例4: layout
import com.watabou.noosa.Image; //导入依赖的package包/类
@Override
protected void layout() {
bg.x = x;
bg.y = y;
Integer iconInt;
if (item instanceof Scroll) {
iconInt = ((Scroll) item).initials();
} else if (item instanceof Potion) {
iconInt = ((Potion) item).initials();
} else {
iconInt = null;
}
if (iconInt != null && iconVisible) {
bottomRightIcon = new Image(Assets.CONS_ICONS);
int left = iconInt * 7;
int top = item instanceof Potion ? 0 : 8;
bottomRightIcon.frame(left, top, 7, 8);
add(bottomRightIcon);
}
super.layout();
}
示例5: WndInfoBuff
import com.watabou.noosa.Image; //导入依赖的package包/类
public WndInfoBuff(Buff buff) {
super();
IconTitle titlebar = new IconTitle();
icons = TextureCache.get(Assets.BUFFS_LARGE);
film = new TextureFilm(icons, 16, 16);
Image buffIcon = new Image(icons);
buffIcon.frame(film.get(buff.icon()));
titlebar.icon(buffIcon);
titlebar.label(Messages.titleCase(buff.toString()), Window.TITLE_COLOR);
titlebar.setRect(0, 0, WIDTH, 0);
add(titlebar);
RenderedTextMultiline txtInfo = PixelScene.renderMultiline(buff.desc(), 6);
txtInfo.maxWidth(WIDTH);
txtInfo.setPos(titlebar.left(), titlebar.bottom() + GAP);
add(txtInfo);
resize(WIDTH, (int) (txtInfo.top() + txtInfo.height()));
}
示例6: createChildren
import com.watabou.noosa.Image; //导入依赖的package包/类
@Override
protected void createChildren() {
bar = new Image(asset, 0, 0, 64, 16);
add(bar);
width = bar.width;
height = bar.height;
hp = new Image(asset, 15, 19, 47, 4);
add(hp);
skull = new Image(asset, 5, 18, 6, 6);
add(skull);
blood = new Emitter();
blood.pos(skull);
blood.pour(BloodParticle.FACTORY, 0.3f);
blood.autoKill = false;
blood.on = false;
add(blood);
}
示例7: get
import com.watabou.noosa.Image; //导入依赖的package包/类
public static Image get(Type type) {
Image icon = new Image(Assets.BANNERS);
switch (type) {
case PIXEL_DUNGEON:
icon.frame(icon.texture.uvRect(0, 0, 128, 70));
break;
case BOSS_SLAIN:
icon.frame(icon.texture.uvRect(0, 70, 128, 105));
break;
case GAME_OVER:
icon.frame(icon.texture.uvRect(0, 105, 128, 140));
break;
case SELECT_YOUR_HERO:
icon.frame(icon.texture.uvRect(0, 140, 128, 161));
break;
case PIXEL_DUNGEON_SIGNS:
icon.frame(icon.texture.uvRect(0, 161, 128, 218));
break;
case CLEARED:
icon.frame(icon.texture.uvRect(0, 230, 128, 250));
break;
}
return icon;
}
示例8: emit
import com.watabou.noosa.Image; //导入依赖的package包/类
@Override
protected void emit(int index) {
RectF frame = ((Image) target).frame();
float ofsX = frame.left * mapW;
float ofsY = frame.top * mapH;
float x, y;
do {
x = Random.Float(frame.width()) * mapW;
y = Random.Float(frame.height()) * mapH;
} while ((map.bitmap.getPixel((int) (x + ofsX), (int) (y + ofsY)) & 0x000000FF) == 0);
factory.emit(this, index,
target.x + x * target.scale.x,
target.y + y * target.scale.y);
}
示例9: emit
import com.watabou.noosa.Image; //导入依赖的package包/类
@Override
protected void emit( int index ) {
RectF frame = ((Image)target).frame();
float ofsX = frame.left * mapW;
float ofsY = frame.top * mapH;
float x, y;
do {
x = Random.Float( frame.width() ) * mapW;
y = Random.Float( frame.height() ) * mapH;
} while ((map.bitmap.getPixel( (int)(x + ofsX), (int)(y + ofsY) ) & 0x000000FF) == 0);
factory.emit( this, index,
target.x + x * target.scale.x,
target.y + y * target.scale.y );
}
示例10: getIcon
import com.watabou.noosa.Image; //导入依赖的package包/类
@Override
public Image getIcon() {
Image icon;
if (((Hero)target).belongings.weapon != null){
icon = new ItemSprite(Dungeon.hero.belongings.weapon.image, null);
} else {
icon = new ItemSprite(new Item(){ {image = ItemSpriteSheet.WEAPON_HOLDER; }});
}
if (count >= 10) icon.tint(0xFFFF0000);
else if (count >= 8)icon.tint(0xFFFFCC00);
else if (count >= 6)icon.tint(0xFFFFFF00);
else if (count >= 4)icon.tint(0xFFCCFF00);
else icon.tint(0xFF00FF00);
return icon;
}
示例11: createChildren
import com.watabou.noosa.Image; //导入依赖的package包/类
@Override
protected void createChildren() {
super.createChildren();
shield = new ItemSprite( ItemSpriteSheet.TOMB, null );
add( shield );
position = new BitmapText( PixelScene.pixelFont);
position.alpha(0.8f);
add( position );
desc = renderMultiline( 7 );
add( desc );
depth = new BitmapText( PixelScene.pixelFont);
depth.alpha(0.8f);
steps = new Image();
classIcon = new Image();
add( classIcon );
level = new BitmapText( PixelScene.pixelFont);
level.alpha(0.8f);
}
示例12: WndInfoBuff
import com.watabou.noosa.Image; //导入依赖的package包/类
public WndInfoBuff(Buff buff){
super();
IconTitle titlebar = new IconTitle();
icons = TextureCache.get( Assets.BUFFS_LARGE );
film = new TextureFilm( icons, 16, 16 );
Image buffIcon = new Image( icons );
buffIcon.frame( film.get(buff.icon()) );
titlebar.icon( buffIcon );
titlebar.label( Messages.titleCase(buff.toString()), Window.TITLE_COLOR );
titlebar.setRect( 0, 0, WIDTH, 0 );
add( titlebar );
RenderedTextMultiline txtInfo = PixelScene.renderMultiline(buff.desc(), 6);
txtInfo.maxWidth(WIDTH);
txtInfo.setPos(titlebar.left(), titlebar.bottom() + GAP);
add( txtInfo );
resize( WIDTH, (int)(txtInfo.top() + txtInfo.height()) );
}
示例13: WndBadge
import com.watabou.noosa.Image; //导入依赖的package包/类
public WndBadge( Badges.Badge badge ) {
super();
Image icon = BadgeBanner.image( badge.image );
icon.scale.set( 2 );
add( icon );
//TODO: this used to be centered, should probably figure that out.
RenderedTextMultiline info = PixelScene.renderMultiline( badge.desc(), 8 );
info.maxWidth(WIDTH - MARGIN * 2);
PixelScene.align(info);
add(info);
float w = Math.max( icon.width(), info.width() ) + MARGIN * 2;
icon.x = (w - icon.width()) / 2f;
icon.y = MARGIN;
PixelScene.align(icon);
info.setPos((w - info.width()) / 2, icon.y + icon.height() + MARGIN);
resize( (int)w, (int)(info.bottom() + MARGIN) );
BadgeBanner.highlight( icon, badge.image );
}
示例14: growPlant
import com.watabou.noosa.Image; //导入依赖的package包/类
public void growPlant( final int pos ){
final Image plant = tile( pos, map[pos] );
plant.origin.set( 8, 12 );
plant.scale.set( 0 );
plant.point( DungeonTilemap.tileToWorld( pos ) );
parent.add( plant );
parent.add( new ScaleTweener( plant, new PointF(1, 1), 0.2f ) {
protected void onComplete() {
plant.killAndErase();
killAndErase();
updateMapCell(pos);
}
} );
}
示例15: createChildren
import com.watabou.noosa.Image; //导入依赖的package包/类
@Override
protected void createChildren() {
bar = new Image(asset, 0, 0, 64, 16);
add(bar);
width = bar.width;
height = bar.height;
hp = new Image(asset, 15, 19, 47, 4);
add(hp);
skull = new Image(asset, 5, 18, 6, 6);
add(skull);
blood = new Emitter();
blood.pos(skull);
blood.pour(BloodParticle.FACTORY, 0.3f);
blood.autoKill = false;
blood.on = false;
add( blood );
}