mirror of
https://inf.pirckheimer-gymnasium.de/kebab/kebab
synced 2026-08-26 16:31:23 +00:00
Titelscreen implementiert
This commit is contained in:
@@ -3,26 +3,46 @@ package project.scenes;
|
||||
import pi.Camera;
|
||||
import pi.Scene;
|
||||
import pi.Text;
|
||||
import pi.actor.Image;
|
||||
import pi.event.FrameListener;
|
||||
|
||||
import static pi.Controller.fonts;
|
||||
import java.awt.Font;
|
||||
|
||||
public class LoadingScene extends Scene
|
||||
public class LoadingScene extends Scene implements FrameListener
|
||||
{
|
||||
private Text title;
|
||||
private Text subtitle;
|
||||
private String subtitle_content;
|
||||
private Image tatli;
|
||||
private double lastUpdated;
|
||||
|
||||
public LoadingScene() {
|
||||
title = new Text("Royal Kebab");
|
||||
subtitle = new Text("Loading...");
|
||||
|
||||
subtitle_content = "Loading";
|
||||
subtitle = new Text(subtitle_content);
|
||||
tatli = new Image("images/kebab-pack/tatli-ekmek-256x256.png");
|
||||
lastUpdated = System.currentTimeMillis();
|
||||
|
||||
Font font = fonts.get("Fonts/BitcountGridDouble-Regular.ttf");
|
||||
title.anchor(0, 0);
|
||||
title.center(0, 3);
|
||||
title.font(font);
|
||||
subtitle.anchor(0, -2);
|
||||
|
||||
subtitle.center(0, -3);
|
||||
subtitle.font(font);
|
||||
|
||||
tatli.center(0,0);
|
||||
|
||||
add(title);
|
||||
add(subtitle);
|
||||
add(tatli);
|
||||
}
|
||||
|
||||
public void onFrame(double pastTime)
|
||||
{
|
||||
if(System.currentTimeMillis() - lastUpdated > 300) {
|
||||
subtitle_content = subtitle_content + ".";
|
||||
subtitle.content(subtitle_content);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user