Merging Source v1.7.2: UI changes
This commit is contained in:
parent
9f9e117c95
commit
735af276c8
|
@ -24,42 +24,50 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
|
|
||||||
public class Archs extends Component {
|
public class Archs extends Component {
|
||||||
|
|
||||||
private static final float SCROLL_SPEED = 20f;
|
private static final float SCROLL_SPEED = 20f;
|
||||||
|
|
||||||
private SkinnedBlock arcsBg;
|
private SkinnedBlock arcsBg;
|
||||||
private SkinnedBlock arcsFg;
|
private SkinnedBlock arcsFg;
|
||||||
|
|
||||||
public boolean reversed = false;
|
private static float offsB = 0;
|
||||||
|
private static float offsF = 0;
|
||||||
@Override
|
|
||||||
protected void createChildren() {
|
public boolean reversed = false;
|
||||||
arcsBg = new SkinnedBlock( 1, 1, Assets.ARCS_BG );
|
|
||||||
add( arcsBg );
|
@Override
|
||||||
|
protected void createChildren() {
|
||||||
arcsFg = new SkinnedBlock( 1, 1, Assets.ARCS_FG );
|
arcsBg = new SkinnedBlock( 1, 1, Assets.ARCS_BG );
|
||||||
add( arcsFg );
|
arcsBg.offsetTo( 0, offsB );
|
||||||
}
|
add( arcsBg );
|
||||||
|
|
||||||
@Override
|
arcsFg = new SkinnedBlock( 1, 1, Assets.ARCS_FG );
|
||||||
protected void layout() {
|
arcsFg.offsetTo( 0, offsF );
|
||||||
arcsBg.size( width, height );
|
add( arcsFg );
|
||||||
arcsBg.offset( arcsBg.texture.width / 4 - (width % arcsBg.texture.width) / 2, 0 );
|
}
|
||||||
|
|
||||||
arcsFg.size( width, height );
|
@Override
|
||||||
arcsFg.offset( arcsFg.texture.width / 4 - (width % arcsFg.texture.width) / 2, 0 );
|
protected void layout() {
|
||||||
}
|
arcsBg.size( width, height );
|
||||||
|
arcsBg.offset( arcsBg.texture.width / 4 - (width % arcsBg.texture.width) / 2, 0 );
|
||||||
@Override
|
|
||||||
public void update() {
|
arcsFg.size( width, height );
|
||||||
|
arcsFg.offset( arcsFg.texture.width / 4 - (width % arcsFg.texture.width) / 2, 0 );
|
||||||
super.update();
|
}
|
||||||
|
|
||||||
float shift = Game.elapsed * SCROLL_SPEED;
|
@Override
|
||||||
if (reversed) {
|
public void update() {
|
||||||
shift = -shift;
|
|
||||||
}
|
super.update();
|
||||||
|
|
||||||
arcsBg.offset( 0, shift );
|
float shift = Game.elapsed * SCROLL_SPEED;
|
||||||
arcsFg.offset( 0, shift * 2 );
|
if (reversed) {
|
||||||
}
|
shift = -shift;
|
||||||
|
}
|
||||||
|
|
||||||
|
arcsBg.offset( 0, shift );
|
||||||
|
arcsFg.offset( 0, shift * 2 );
|
||||||
|
|
||||||
|
offsB = arcsBg.offsetY();
|
||||||
|
offsF = arcsFg.offsetY();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,6 +66,7 @@ public class BuffIndicator extends Component {
|
||||||
public static final int MAGIC_SLEEP = 30;
|
public static final int MAGIC_SLEEP = 30;
|
||||||
public static final int THORNS = 31;
|
public static final int THORNS = 31;
|
||||||
public static final int FORESIGHT = 32;
|
public static final int FORESIGHT = 32;
|
||||||
|
public static final int VERTIGO = 33;
|
||||||
|
|
||||||
public static final int SIZE = 7;
|
public static final int SIZE = 7;
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class DangerIndicator extends Tag {
|
||||||
int v = Dungeon.hero.visibleEnemies();
|
int v = Dungeon.hero.visibleEnemies();
|
||||||
if (v != lastNumber) {
|
if (v != lastNumber) {
|
||||||
lastNumber = v;
|
lastNumber = v;
|
||||||
if (visible = (lastNumber > 0)) {
|
if (visible = lastNumber > 0) {
|
||||||
number.text( Integer.toString( lastNumber ) );
|
number.text( Integer.toString( lastNumber ) );
|
||||||
number.measure();
|
number.measure();
|
||||||
placeNumber();
|
placeNumber();
|
||||||
|
|
|
@ -1,7 +1,74 @@
|
||||||
|
/*
|
||||||
|
* Pixel Dungeon
|
||||||
|
* Copyright (C) 2012-2014 Oleg Dolya
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
*/
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.ui;
|
package com.shatteredpixel.shatteredpixeldungeon.ui;
|
||||||
|
|
||||||
/**
|
import com.watabou.noosa.Game;
|
||||||
* Created by Evan on 18/10/2014.
|
import com.watabou.noosa.Image;
|
||||||
*/
|
import com.watabou.noosa.audio.Sample;
|
||||||
public class ExitButton {
|
import com.watabou.noosa.ui.Button;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.TitleScene;
|
||||||
|
|
||||||
|
public class ExitButton extends Button {
|
||||||
|
|
||||||
|
private Image image;
|
||||||
|
|
||||||
|
public ExitButton() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
width = image.width;
|
||||||
|
height = image.height;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void createChildren() {
|
||||||
|
super.createChildren();
|
||||||
|
|
||||||
|
image = Icons.EXIT.get();
|
||||||
|
add( image );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void layout() {
|
||||||
|
super.layout();
|
||||||
|
|
||||||
|
image.x = x;
|
||||||
|
image.y = y;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onTouchDown() {
|
||||||
|
image.brightness( 1.5f );
|
||||||
|
Sample.INSTANCE.play( Assets.SND_CLICK );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onTouchUp() {
|
||||||
|
image.resetColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onClick() {
|
||||||
|
if (Game.scene() instanceof TitleScene) {
|
||||||
|
Game.instance.finish();
|
||||||
|
} else {
|
||||||
|
ShatteredPixelDungeon.switchNoFade( TitleScene.class );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,10 @@ public enum Icons {
|
||||||
SCROLL_HOLDER,
|
SCROLL_HOLDER,
|
||||||
WAND_HOLSTER,
|
WAND_HOLSTER,
|
||||||
CHECKED,
|
CHECKED,
|
||||||
UNCHECKED;
|
UNCHECKED,
|
||||||
|
EXIT,
|
||||||
|
CHALLENGE_OFF,
|
||||||
|
CHALLENGE_ON;
|
||||||
|
|
||||||
public Image get() {
|
public Image get() {
|
||||||
return get( this );
|
return get( this );
|
||||||
|
@ -135,6 +138,15 @@ public enum Icons {
|
||||||
case UNCHECKED:
|
case UNCHECKED:
|
||||||
icon.frame( icon.texture.uvRect( 66, 12, 78, 24 ) );
|
icon.frame( icon.texture.uvRect( 66, 12, 78, 24 ) );
|
||||||
break;
|
break;
|
||||||
|
case EXIT:
|
||||||
|
icon.frame( icon.texture.uvRect( 98, 0, 114, 16 ) );
|
||||||
|
break;
|
||||||
|
case CHALLENGE_OFF:
|
||||||
|
icon.frame( icon.texture.uvRect( 78, 16, 102, 40 ) );
|
||||||
|
break;
|
||||||
|
case CHALLENGE_ON:
|
||||||
|
icon.frame( icon.texture.uvRect( 102, 16, 126, 40 ) );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,6 @@ public class ItemSlot extends Button {
|
||||||
private static final String TXT_TYPICAL_STR = "%d?";
|
private static final String TXT_TYPICAL_STR = "%d?";
|
||||||
|
|
||||||
private static final String TXT_LEVEL = "%+d";
|
private static final String TXT_LEVEL = "%+d";
|
||||||
private static final String TXT_CURSED = "";
|
|
||||||
|
|
||||||
// Special items for containers
|
// Special items for containers
|
||||||
public static final Item CHEST = new Item() {
|
public static final Item CHEST = new Item() {
|
||||||
|
@ -164,7 +163,7 @@ public class ItemSlot extends Button {
|
||||||
int level = item.visiblyUpgraded();
|
int level = item.visiblyUpgraded();
|
||||||
|
|
||||||
if (level != 0 || (item.cursed && item.cursedKnown)) {
|
if (level != 0 || (item.cursed && item.cursedKnown)) {
|
||||||
bottomRight.text( item.levelKnown ? Utils.format( TXT_LEVEL, level ) : TXT_CURSED );
|
bottomRight.text( item.levelKnown ? Utils.format( TXT_LEVEL, level ) : "" );
|
||||||
bottomRight.measure();
|
bottomRight.measure();
|
||||||
bottomRight.hardlight( level > 0 ? UPGRADED : DEGRADED );
|
bottomRight.hardlight( level > 0 ? UPGRADED : DEGRADED );
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -23,7 +23,9 @@ import com.watabou.noosa.Camera;
|
||||||
import com.watabou.noosa.Image;
|
import com.watabou.noosa.Image;
|
||||||
import com.watabou.noosa.NinePatch;
|
import com.watabou.noosa.NinePatch;
|
||||||
import com.watabou.noosa.TouchArea;
|
import com.watabou.noosa.TouchArea;
|
||||||
|
import com.watabou.noosa.audio.Sample;
|
||||||
import com.watabou.noosa.particles.Emitter;
|
import com.watabou.noosa.particles.Emitter;
|
||||||
|
import com.watabou.noosa.ui.Button;
|
||||||
import com.watabou.noosa.ui.Component;
|
import com.watabou.noosa.ui.Component;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
|
@ -33,167 +35,219 @@ import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.windows.WndGame;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndHero;
|
import com.shatteredpixel.shatteredpixeldungeon.windows.WndHero;
|
||||||
|
|
||||||
public class StatusPane extends Component {
|
public class StatusPane extends Component {
|
||||||
|
|
||||||
private NinePatch shield;
|
private NinePatch shield;
|
||||||
private Image avatar;
|
private Image avatar;
|
||||||
private Emitter blood;
|
private Emitter blood;
|
||||||
|
|
||||||
private int lastTier = 0;
|
private int lastTier = 0;
|
||||||
|
|
||||||
private Image hp;
|
private Image hp;
|
||||||
private Image exp;
|
private Image exp;
|
||||||
|
|
||||||
private int lastLvl = -1;
|
private int lastLvl = -1;
|
||||||
private int lastKeys = -1;
|
private int lastKeys = -1;
|
||||||
|
|
||||||
private BitmapText level;
|
private BitmapText level;
|
||||||
private BitmapText depth;
|
private BitmapText depth;
|
||||||
private BitmapText keys;
|
private BitmapText keys;
|
||||||
|
|
||||||
private DangerIndicator danger;
|
private DangerIndicator danger;
|
||||||
private LootIndicator loot;
|
private LootIndicator loot;
|
||||||
private BuffIndicator buffs;
|
private BuffIndicator buffs;
|
||||||
private Compass compass;
|
private Compass compass;
|
||||||
|
|
||||||
@Override
|
private MenuButton btnMenu;
|
||||||
protected void createChildren() {
|
|
||||||
|
@Override
|
||||||
shield = new NinePatch( Assets.STATUS, 80, 0, 30, 0 );
|
protected void createChildren() {
|
||||||
add( shield );
|
|
||||||
|
shield = new NinePatch( Assets.STATUS, 80, 0, 30 + 18, 0 );
|
||||||
add( new TouchArea( 0, 1, 30, 30 ) {
|
add( shield );
|
||||||
@Override
|
|
||||||
protected void onClick( Touch touch ) {
|
add( new TouchArea( 0, 1, 30, 30 ) {
|
||||||
Image sprite = Dungeon.hero.sprite;
|
@Override
|
||||||
if (!sprite.isVisible()) {
|
protected void onClick( Touch touch ) {
|
||||||
Camera.main.focusOn( sprite );
|
Image sprite = Dungeon.hero.sprite;
|
||||||
}
|
if (!sprite.isVisible()) {
|
||||||
GameScene.show( new WndHero() );
|
Camera.main.focusOn( sprite );
|
||||||
};
|
}
|
||||||
} );
|
GameScene.show( new WndHero() );
|
||||||
|
};
|
||||||
avatar = HeroSprite.avatar( Dungeon.hero.heroClass, lastTier );
|
} );
|
||||||
add( avatar );
|
|
||||||
|
btnMenu = new MenuButton();
|
||||||
blood = new Emitter();
|
add( btnMenu );
|
||||||
blood.pos( avatar );
|
|
||||||
blood.pour( BloodParticle.FACTORY, 0.3f );
|
avatar = HeroSprite.avatar( Dungeon.hero.heroClass, lastTier );
|
||||||
blood.autoKill = false;
|
add( avatar );
|
||||||
blood.on = false;
|
|
||||||
add( blood );
|
blood = new Emitter();
|
||||||
|
blood.pos( avatar );
|
||||||
compass = new Compass( Dungeon.level.exit );
|
blood.pour( BloodParticle.FACTORY, 0.3f );
|
||||||
add( compass );
|
blood.autoKill = false;
|
||||||
|
blood.on = false;
|
||||||
hp = new Image( Assets.HP_BAR );
|
add( blood );
|
||||||
add( hp );
|
|
||||||
|
compass = new Compass( Dungeon.level.exit );
|
||||||
exp = new Image( Assets.XP_BAR );
|
add( compass );
|
||||||
add( exp );
|
|
||||||
|
hp = new Image( Assets.HP_BAR );
|
||||||
level = new BitmapText( PixelScene.font1x );
|
add( hp );
|
||||||
level.hardlight( 0xFFEBA4 );
|
|
||||||
add( level );
|
exp = new Image( Assets.XP_BAR );
|
||||||
|
add( exp );
|
||||||
depth = new BitmapText( Integer.toString( Dungeon.depth ), PixelScene.font1x );
|
|
||||||
depth.hardlight( 0xCACFC2 );
|
level = new BitmapText( PixelScene.font1x );
|
||||||
depth.measure();
|
level.hardlight( 0xFFEBA4 );
|
||||||
add( depth );
|
add( level );
|
||||||
|
|
||||||
Dungeon.hero.belongings.countIronKeys();
|
depth = new BitmapText( Integer.toString( Dungeon.depth ), PixelScene.font1x );
|
||||||
keys = new BitmapText( PixelScene.font1x );
|
depth.hardlight( 0xCACFC2 );
|
||||||
keys.hardlight( 0xCACFC2 );
|
depth.measure();
|
||||||
add( keys );
|
add( depth );
|
||||||
|
|
||||||
danger = new DangerIndicator();
|
Dungeon.hero.belongings.countIronKeys();
|
||||||
add( danger );
|
keys = new BitmapText( PixelScene.font1x );
|
||||||
|
keys.hardlight( 0xCACFC2 );
|
||||||
loot = new LootIndicator();
|
add( keys );
|
||||||
add( loot );
|
|
||||||
|
danger = new DangerIndicator();
|
||||||
buffs = new BuffIndicator( Dungeon.hero );
|
add( danger );
|
||||||
add( buffs );
|
|
||||||
}
|
loot = new LootIndicator();
|
||||||
|
add( loot );
|
||||||
@Override
|
|
||||||
protected void layout() {
|
buffs = new BuffIndicator( Dungeon.hero );
|
||||||
|
add( buffs );
|
||||||
height = 32;
|
}
|
||||||
|
|
||||||
shield.size( width, shield.height );
|
@Override
|
||||||
|
protected void layout() {
|
||||||
avatar.x = PixelScene.align( camera(), shield.x + 15 - avatar.width / 2 );
|
|
||||||
avatar.y = PixelScene.align( camera(), shield.y + 16 - avatar.height / 2 );
|
height = 32;
|
||||||
|
|
||||||
compass.x = avatar.x + avatar.width / 2 - compass.origin.x;
|
shield.size( width, shield.height );
|
||||||
compass.y = avatar.y + avatar.height / 2 - compass.origin.y;
|
|
||||||
|
avatar.x = PixelScene.align( camera(), shield.x + 15 - avatar.width / 2 );
|
||||||
hp.x = 30;
|
avatar.y = PixelScene.align( camera(), shield.y + 16 - avatar.height / 2 );
|
||||||
hp.y = 3;
|
|
||||||
|
compass.x = avatar.x + avatar.width / 2 - compass.origin.x;
|
||||||
depth.x = width - 24 - depth.width();
|
compass.y = avatar.y + avatar.height / 2 - compass.origin.y;
|
||||||
depth.y = 6;
|
|
||||||
|
hp.x = 30;
|
||||||
keys.y = 6;
|
hp.y = 3;
|
||||||
|
|
||||||
danger.setPos( width - danger.width(), 20 );
|
depth.x = width - 24 - depth.width() - 18;
|
||||||
|
depth.y = 6;
|
||||||
loot.setPos( width - loot.width(), danger.bottom() + 2 );
|
|
||||||
|
keys.y = 6;
|
||||||
buffs.setPos( 32, 11 );
|
|
||||||
}
|
danger.setPos( width - danger.width(), 20 );
|
||||||
|
|
||||||
@Override
|
loot.setPos( width - loot.width(), danger.bottom() + 2 );
|
||||||
public void update() {
|
|
||||||
super.update();
|
buffs.setPos( 32, 11 );
|
||||||
|
|
||||||
float health = (float)Dungeon.hero.HP / Dungeon.hero.HT;
|
btnMenu.setPos( width - btnMenu.width(), 1 );
|
||||||
|
}
|
||||||
if (health == 0) {
|
|
||||||
avatar.tint( 0x000000, 0.6f );
|
@Override
|
||||||
blood.on = false;
|
public void update() {
|
||||||
} else if (health < 0.25f) {
|
super.update();
|
||||||
avatar.tint( 0xcc0000, 0.4f );
|
|
||||||
blood.on = true;
|
float health = (float)Dungeon.hero.HP / Dungeon.hero.HT;
|
||||||
} else {
|
|
||||||
avatar.resetColor();
|
if (health == 0) {
|
||||||
blood.on = false;
|
avatar.tint( 0x000000, 0.6f );
|
||||||
}
|
blood.on = false;
|
||||||
|
} else if (health < 0.25f) {
|
||||||
hp.scale.x = health;
|
avatar.tint( 0xcc0000, 0.4f );
|
||||||
exp.scale.x = (width / exp.width) * Dungeon.hero.exp / Dungeon.hero.maxExp();
|
blood.on = true;
|
||||||
|
} else {
|
||||||
if (Dungeon.hero.lvl != lastLvl) {
|
avatar.resetColor();
|
||||||
|
blood.on = false;
|
||||||
if (lastLvl != -1) {
|
}
|
||||||
Emitter emitter = (Emitter)recycle( Emitter.class );
|
|
||||||
emitter.revive();
|
hp.scale.x = health;
|
||||||
emitter.pos( 27, 27 );
|
exp.scale.x = (width / exp.width) * Dungeon.hero.exp / Dungeon.hero.maxExp();
|
||||||
emitter.burst( Speck.factory( Speck.STAR ), 12 );
|
|
||||||
}
|
if (Dungeon.hero.lvl != lastLvl) {
|
||||||
|
|
||||||
lastLvl = Dungeon.hero.lvl;
|
if (lastLvl != -1) {
|
||||||
level.text( Integer.toString( lastLvl ) );
|
Emitter emitter = (Emitter)recycle( Emitter.class );
|
||||||
level.measure();
|
emitter.revive();
|
||||||
level.x = PixelScene.align( 27.0f - level.width() / 2 );
|
emitter.pos( 27, 27 );
|
||||||
level.y = PixelScene.align( 27.5f - level.baseLine() / 2 );
|
emitter.burst( Speck.factory( Speck.STAR ), 12 );
|
||||||
}
|
}
|
||||||
|
|
||||||
int k = IronKey.curDepthQunatity;
|
lastLvl = Dungeon.hero.lvl;
|
||||||
if (k != lastKeys) {
|
level.text( Integer.toString( lastLvl ) );
|
||||||
lastKeys = k;
|
level.measure();
|
||||||
keys.text( Integer.toString( lastKeys ) );
|
level.x = PixelScene.align( 27.0f - level.width() / 2 );
|
||||||
keys.measure();
|
level.y = PixelScene.align( 27.5f - level.baseLine() / 2 );
|
||||||
keys.x = width - 8 - keys.width();
|
}
|
||||||
}
|
|
||||||
|
int k = IronKey.curDepthQuantity;
|
||||||
int tier = Dungeon.hero.tier();
|
if (k != lastKeys) {
|
||||||
if (tier != lastTier) {
|
lastKeys = k;
|
||||||
lastTier = tier;
|
keys.text( Integer.toString( lastKeys ) );
|
||||||
avatar.copy( HeroSprite.avatar( Dungeon.hero.heroClass, tier ) );
|
keys.measure();
|
||||||
}
|
keys.x = width - 8 - keys.width() - 18;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int tier = Dungeon.hero.tier();
|
||||||
|
if (tier != lastTier) {
|
||||||
|
lastTier = tier;
|
||||||
|
avatar.copy( HeroSprite.avatar( Dungeon.hero.heroClass, tier ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class MenuButton extends Button {
|
||||||
|
|
||||||
|
private Image image;
|
||||||
|
|
||||||
|
public MenuButton() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
width = image.width + 4;
|
||||||
|
height = image.height + 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void createChildren() {
|
||||||
|
super.createChildren();
|
||||||
|
|
||||||
|
image = new Image( Assets.STATUS, 114, 3, 12, 11 );
|
||||||
|
add( image );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void layout() {
|
||||||
|
super.layout();
|
||||||
|
|
||||||
|
image.x = x + 2;
|
||||||
|
image.y = y + 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onTouchDown() {
|
||||||
|
image.brightness( 1.5f );
|
||||||
|
Sample.INSTANCE.play( Assets.SND_CLICK );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onTouchUp() {
|
||||||
|
image.resetColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onClick() {
|
||||||
|
GameScene.show( new WndGame() );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user