added gradient background to main menu
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
package zero1hd.rhythmbullet;
|
||||
|
||||
import java.awt.Checkbox;
|
||||
|
||||
import com.badlogic.gdx.Application;
|
||||
import com.badlogic.gdx.Game;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
@@ -193,6 +191,7 @@ public class RhythmBullet extends Game {
|
||||
assetManager.load("beateffect.p", ParticleEffect.class);
|
||||
assetManager.load("tpSelector.png", Texture.class);
|
||||
assetManager.load("magic1.png", Texture.class);
|
||||
assetManager.load("gradients.atlas", TextureAtlas.class);
|
||||
}
|
||||
|
||||
public void generateFonts(final int height) {
|
||||
|
@@ -2,6 +2,7 @@ package zero1hd.rhythmbullet.graphics.ui.pages;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
|
||||
import com.badlogic.gdx.math.Vector3;
|
||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Label;
|
||||
@@ -33,6 +34,7 @@ public class MainPage extends Page implements OnDifferentSongListener {
|
||||
private ScrollText scrollText;
|
||||
public MainPage(RhythmBullet core, Vector3 targetPosition, SongListController sc) {
|
||||
this.sc = sc;
|
||||
setTextureBackground(core.getAssetManager().get("gradients.atlas", TextureAtlas.class).findRegion("red-linear"));
|
||||
|
||||
titleBar = new TitleBarVisualizer(core.getAssetManager());
|
||||
addActor(titleBar);
|
||||
|
@@ -1,6 +1,9 @@
|
||||
package zero1hd.rhythmbullet.graphics.ui.pages;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import com.badlogic.gdx.scenes.scene2d.Group;
|
||||
import com.badlogic.gdx.scenes.scene2d.Touchable;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Label;
|
||||
@@ -11,7 +14,7 @@ import zero1hd.rhythmbullet.util.MiniSender;
|
||||
|
||||
public class Page extends Group implements Disposable {
|
||||
private Label pageTitle;
|
||||
|
||||
private TextureRegion background;
|
||||
public MiniSender miniSender;
|
||||
|
||||
public Page() {
|
||||
@@ -33,10 +36,22 @@ public class Page extends Group implements Disposable {
|
||||
return pageTitle.getY();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Batch batch, float parentAlpha) {
|
||||
if (background != null) {
|
||||
batch.draw(background, 0, 0, getWidth(), getHeight());
|
||||
}
|
||||
super.draw(batch, parentAlpha);
|
||||
}
|
||||
|
||||
public void addSpaceToTitle(float space) {
|
||||
pageTitle.moveBy(space, 0);
|
||||
}
|
||||
|
||||
public void setTextureBackground(TextureRegion texture) {
|
||||
background = texture;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
}
|
||||
|
Reference in New Issue
Block a user