mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
Have a faded life total over the avatar which glows then fades again reddish for damage and bluish for life gain.
This commit is contained in:
parent
08ffbecdb4
commit
938ac35981
2 changed files with 7 additions and 5 deletions
|
@ -52,7 +52,7 @@ public class HoverButton extends JPanel implements MouseListener {
|
|||
private Command onHover = null;
|
||||
private Color textColor = Color.white;
|
||||
private final Rectangle centerTextArea = new Rectangle(5, 18, 75, 40);
|
||||
private Color centerTextColor = Color.YELLOW;
|
||||
private Color centerTextColor = new Color(200, 190, 0, 180);
|
||||
private final Color textBGColor = Color.black;
|
||||
|
||||
static final Font textFont = new Font("Arial", Font.PLAIN, 12);
|
||||
|
|
|
@ -202,10 +202,11 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
if (playerLife > pastLife) {
|
||||
if (faderGainLife == null && doGainFade) {
|
||||
doGainFade = false;
|
||||
faderGainLife = new Timer(25, new ActionListener() {
|
||||
faderGainLife = new Timer(50, new ActionListener() {
|
||||
public void actionPerformed(ActionEvent ae) {
|
||||
gainX++;
|
||||
avatar.setCenterColor(new Color(2 * gainX, 190, 255, 250 - gainX));
|
||||
int alpha = Math.max(250 - gainX, 180);
|
||||
avatar.setCenterColor(new Color(2 * gainX, 190, 255, alpha));
|
||||
avatar.repaint();
|
||||
if (gainX >= 100) {
|
||||
avatar.setCenterColor(new Color(200, 190, 0, 180));
|
||||
|
@ -227,10 +228,11 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
} else if (playerLife < pastLife) {
|
||||
if (faderLoseLife == null && doLoseFade) {
|
||||
doLoseFade = false;
|
||||
faderLoseLife = new Timer(25, new ActionListener() {
|
||||
faderLoseLife = new Timer(50, new ActionListener() {
|
||||
public void actionPerformed(ActionEvent ae) {
|
||||
loseX++;
|
||||
avatar.setCenterColor(new Color(250 - loseX / 2, 140 + loseX / 2, 0, 250 - loseX));
|
||||
int alpha = Math.max(250 - loseX, 180);
|
||||
avatar.setCenterColor(new Color(250 - loseX / 2, 140 + loseX / 2, 0, alpha));
|
||||
avatar.repaint();
|
||||
if (loseX >= 100) {
|
||||
avatar.setCenterColor(new Color(200, 190, 0, 180));
|
||||
|
|
Loading…
Reference in a new issue