Skip to content

Commit

Permalink
Merge branch 'team-2-ui' of https://github.com/UQcsse3200/2023-studio-3
Browse files Browse the repository at this point in the history
… into praneet-ui-improvements
  • Loading branch information
praneetdhoolia committed Oct 16, 2023
2 parents be41a1d + 33cb08c commit 2e63eca
Show file tree
Hide file tree
Showing 16 changed files with 496 additions and 396 deletions.
219 changes: 120 additions & 99 deletions source/core/assets/images/ui/buttons/glass.atlas

Large diffs are not rendered by default.

108 changes: 108 additions & 0 deletions source/core/assets/images/ui/buttons/glass.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,87 @@ com.badlogic.gdx.scenes.scene2d.ui.Skin$TintedDrawable: {
a: 1
}
}
pierce_tower_selected: {
name: pierce-tower-default
color: {
r: 0
g: 0.74509805
b: 0.003921569
a: 1
}
}
ricochet_tower_selected: {
name: ricochet-tower-default
color: {
r: 0
g: 0.74509805
b: 0.003921569
a: 1
}
}
firework_tower_selected: {
name: firework-tower-default
color: {
r: 0
g: 0.74509805
b: 0.003921569
a: 1
}
}
pierce_tower_disabled: {
name: pierce-tower-default
color: {
r: 0.8156863
g: 0
b: 0
a: 1
}
}
ricochet_tower_disabled: {
name: ricochet-tower-default
color: {
r: 0.8156863
g: 0
b: 0
a: 1
}
}
firework_tower_disabled: {
name: firework-tower-default
color: {
r: 0.8156863
g: 0
b: 0
a: 1
}
}
pierce_tower_over: {
name: pierce-tower-default
color: {
r: 0
g: 0.9137255
b: 0.9843137
a: 1
}
}
ricochet_tower_over: {
name: ricochet-tower-default
color: {
r: 0
g: 0.9137255
b: 0.9843137
a: 1
}
}
firework_tower_over: {
name: firework-tower-default
color: {
r: 0
g: 0.9137255
b: 0.9843137
a: 1
}
}
}
com.badlogic.gdx.scenes.scene2d.ui.Button$ButtonStyle: {
default: {
Expand Down Expand Up @@ -396,6 +477,33 @@ com.badlogic.gdx.scenes.scene2d.ui.ImageButton$ImageButtonStyle: {
imageCheckedDown: mine_tower_down
imageCheckedOver: mine_tower_over
}
pierce_tower: {
imageUp: pierce-tower-default
imageDown: pierce_tower_selected
imageOver: pierce_tower_over
imageDisabled: pierce_tower_disabled
imageChecked: pierce_tower_selected
imageCheckedDown: pierce_tower_selected
imageCheckedOver: pierce_tower_over
}
ricochet_tower: {
imageUp: ricochet-tower-default
imageDown: ricochet_tower_selected
imageOver: ricochet_tower_over
imageDisabled: ricochet_tower_disabled
imageChecked: ricochet_tower_selected
imageCheckedDown: ricochet_tower_selected
imageCheckedOver: ricochet_tower_over
}
fireworks_tower: {
imageUp: firework-tower-default
imageDown: firework_tower_selected
imageOver: firework_tower_over
imageDisabled: firework_tower_disabled
imageChecked: firework_tower_selected
imageCheckedDown: firework_tower_selected
imageCheckedOver: firework_tower_over
}
}
com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle: {
default: {
Expand Down
Binary file modified source/core/assets/images/ui/buttons/glass.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.csse3200.game.components.gamearea;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.graphics.Camera;
import com.badlogic.gdx.graphics.Texture;
Expand Down Expand Up @@ -56,11 +57,17 @@ private void addActors() {
ServiceLocator.getCurrencyService().getCrystal().getAmount());

table.add(scrapsTb).width(scrapsTb.getWidth() * 0.5f).height(scrapsTb.getHeight() * 0.5f);
table.row();
table.add(crystalsTb).width(crystalsTb.getWidth() * 0.5f).height(crystalsTb.getHeight() * 0.5f);
stage.addActor(table);

scrapsTb.addAction(new SequenceAction(Actions.fadeIn(4f)));
crystalsTb.addAction(new SequenceAction(Actions.fadeIn(8f)));
scrapsTb.setPosition(table.getX() - 200, Gdx.graphics.getHeight() - 205);
scrapsTb.addAction(new SequenceAction(Actions.moveTo(table.getX() + 20, Gdx.graphics.getHeight() - 205,
1f, Interpolation.fastSlow)));

crystalsTb.setPosition(table.getX() - 200, Gdx.graphics.getHeight() - 268);
crystalsTb.addAction(new SequenceAction(Actions.moveTo(table.getX() + 20, Gdx.graphics.getHeight() - 268,
1f, Interpolation.fastSlow)));
}

private TextButton createButton(String imageFilePath, int value) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.csse3200.game.components.gamearea;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.math.Interpolation;
import com.badlogic.gdx.scenes.scene2d.Touchable;
import com.badlogic.gdx.scenes.scene2d.actions.Actions;
import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction;
Expand Down Expand Up @@ -57,7 +59,10 @@ private void addActors() {
table.add(engineerTb).width(engineerTb.getWidth() * 0.5f).height(engineerTb.getHeight() * 0.5f);
stage.addActor(table);

engineerTb.addAction(new SequenceAction(Actions.fadeIn(4f)));
// Animate the engineer count label
engineerTb.setPosition(table.getX() - 200, Gdx.graphics.getHeight() - 145);
engineerTb.addAction(new SequenceAction(Actions.moveTo(table.getX() + 20, Gdx.graphics.getHeight() - 145,
1f, Interpolation.fastSlow)));
}

/**
Expand Down
Loading

0 comments on commit 2e63eca

Please sign in to comment.