@Override public void onDetached() { super.onDetached(); this.sInvSprite.detachSelf(); this.sAmmoIcon.detachSelf(); this.stAmmoText.detachSelf(); }
@Override public void onAttached() { super.onAttached(); this.attachChild(this.sInvSprite); this.attachChild(this.sAmmoIcon); this.sAmmoIcon.attachChild(this.stAmmoText); }
@Override public void onTouchUp(float x, float y) { super.onTouchUp(x, y); if (!((SessionScene) this.getContext()).getPlayer().canFire()) return; final float DELTA_X = x - this.origoTouchX; this.onSwitchWeapon(DELTA_X < 16f); }
@Override protected void onPress(float x, float y) { super.onPress(x, y); this.origoTouchX = x; }