use of com.watabou.noosa.Image in project shattered-pixel-dungeon-gdx by 00-Evan.
the class WelcomeScene method create.
@Override
public void create() {
super.create();
final int previousVersion = SPDSettings.version();
if (ShatteredPixelDungeon.versionCode == previousVersion) {
ShatteredPixelDungeon.switchNoFade(TitleScene.class);
return;
}
uiCamera.visible = false;
int w = Camera.main.width;
int h = Camera.main.height;
Image title = BannerSprites.get(BannerSprites.Type.PIXEL_DUNGEON);
title.brightness(0.6f);
add(title);
float topRegion = Math.max(95f, h * 0.45f);
title.x = (w - title.width()) / 2f;
if (SPDSettings.landscape())
title.y = (topRegion - title.height()) / 2f;
else
title.y = 16 + (topRegion - title.height() - 16) / 2f;
align(title);
Image signs = new Image(BannerSprites.get(BannerSprites.Type.PIXEL_DUNGEON_SIGNS)) {
private float time = 0;
@Override
public void update() {
super.update();
am = Math.max(0f, (float) Math.sin(time += Game.elapsed));
if (time >= 1.5f * Math.PI)
time = 0;
}
@Override
public void draw() {
Blending.setLightMode();
super.draw();
Blending.setNormalMode();
}
};
signs.x = title.x + (title.width() - signs.width()) / 2f;
signs.y = title.y;
add(signs);
DarkRedButton okay = new DarkRedButton(Messages.get(this, "continue")) {
@Override
protected void onClick() {
super.onClick();
if (previousVersion == 0) {
SPDSettings.version(ShatteredPixelDungeon.versionCode);
WelcomeScene.this.add(new WndStartGame(1));
} else {
updateVersion(previousVersion);
ShatteredPixelDungeon.switchScene(TitleScene.class);
}
}
};
if (previousVersion != 0) {
DarkRedButton changes = new DarkRedButton(Messages.get(this, "changelist")) {
@Override
protected void onClick() {
super.onClick();
updateVersion(previousVersion);
ShatteredPixelDungeon.switchScene(ChangesScene.class);
}
};
okay.setRect(title.x, h - 20, (title.width() / 2) - 2, 16);
okay.textColor(0xBBBB33);
add(okay);
changes.setRect(okay.right() + 2, h - 20, (title.width() / 2) - 2, 16);
changes.textColor(0xBBBB33);
add(changes);
} else {
okay.setRect(title.x, h - 20, title.width(), 16);
okay.textColor(0xBBBB33);
add(okay);
}
RenderedTextMultiline text = PixelScene.renderMultiline(6);
String message;
if (previousVersion == 0) {
message = Messages.get(this, "welcome_msg");
} else if (previousVersion <= ShatteredPixelDungeon.versionCode) {
if (previousVersion < LATEST_UPDATE) {
message = Messages.get(this, "update_intro");
message += "\n\n" + Messages.get(this, "update_msg");
} else {
// TODO: change the messages here in accordance with the type of patch.
message = Messages.get(this, "patch_intro");
message += "\n\n" + Messages.get(this, "patch_bugfixes");
message += "\n" + Messages.get(this, "patch_translations");
message += "\n" + Messages.get(this, "patch_balance");
}
} else {
message = Messages.get(this, "what_msg");
}
text.text(message, w - 20);
float textSpace = h - title.y - (title.height() - 10) - okay.height() - 2;
text.setPos((w - text.width()) / 2f, title.y + (title.height() - 10) + ((textSpace - text.height()) / 2));
add(text);
}
use of com.watabou.noosa.Image in project shattered-pixel-dungeon-gdx by 00-Evan.
the class HeroSprite method avatar.
public static Image avatar(HeroClass cl, int armorTier) {
RectF patch = tiers().get(armorTier);
Image avatar = new Image(cl.spritesheet());
RectF frame = avatar.texture.uvRect(1, 0, FRAME_WIDTH, FRAME_HEIGHT);
frame.shift(patch.left, patch.top);
avatar.frame(frame);
return avatar;
}
use of com.watabou.noosa.Image in project shattered-pixel-dungeon-gdx by 00-Evan.
the class Combo method getIcon.
@Override
public Image getIcon() {
Image icon;
if (((Hero) target).belongings.weapon != null) {
icon = new ItemSprite(((Hero) target).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;
}
use of com.watabou.noosa.Image in project shattered-pixel-dungeon-gdx by 00-Evan.
the class Preparation method getIcon.
@Override
public Image getIcon() {
Image actionIco = Effects.get(Effects.Type.WOUND);
tintIcon(actionIco);
return actionIco;
}
use of com.watabou.noosa.Image in project shattered-pixel-dungeon-gdx by 00-Evan.
the class TerrainFeaturesTilemap method growPlant.
public void growPlant(final int pos) {
final Image plant = tile(pos, map[pos]);
if (plant == null)
return;
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);
}
});
}
Aggregations