forked from asalga/Horadrix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ScreenSplash.pde
58 lines (45 loc) · 1.31 KB
/
ScreenSplash.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
Displays game name and credits
*/
public class ScreenSplash extends IScreen{
Ticker ticker;
RetroFont solarWindsFont;
RetroLabel creditsLabel;
RetroLabel loadingLabel;
RetroLabel mainTitleLabel;
public void OnTransitionTo(){}
public ScreenSplash(){
ticker = new Ticker();
// TODO: convert this to a singleton or factory.
solarWindsFont = new RetroFont("data/fonts/solarwinds.png", 14, 16, 2);
mainTitleLabel = new RetroLabel(solarWindsFont);
mainTitleLabel.setText("H O R A D R I X");
mainTitleLabel.pixelsFromCenter(0, 0);
creditsLabel = new RetroLabel(solarWindsFont);
creditsLabel.setText("Code & Art: Andor Salga");
creditsLabel.setVerticalSpacing(0);
creditsLabel.setHorizontalTrimming(true);
creditsLabel.pixelsFromBottomLeft(0, 0);
loadingLabel = new RetroLabel(solarWindsFont);
loadingLabel.setHorizontalTrimming(true);
loadingLabel.setText("Loading....");
loadingLabel.pixelsFromCenter(0, 50);
}
/**
*/
public void draw(){
background(0);
mainTitleLabel.draw();
creditsLabel.draw();
loadingLabel.draw();
}
public void update(){
ticker.tick();
if(ticker.getTotalTime() > 1.01f){
screens.transitionTo("story");
}
}
public String getName(){
return "splash";
}
}