-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScene.pde
75 lines (57 loc) · 1.73 KB
/
Scene.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
abstract class SceneWithTransition extends Scene //<>// //<>// //<>// //<>// //<>// //<>//
{
SceneTransition sceneEnterTransition;
SceneTransition sceneLeaveTransition;
SceneWithTransition( String backgroundFilename ) {
super(backgroundFilename);
//background = loadImage( filename );
enterTransition = new SceneTransition();
leaveTransition = new SceneTransition();
sceneEnterTransition = (SceneTransition)enterTransition;
sceneLeaveTransition = (SceneTransition)leaveTransition;
sceneEnterTransition.to = 0;
sceneEnterTransition.start = 255;
sceneEnterTransition.easing = Ani.QUAD_IN;
sceneEnterTransition.callBackName = "onEnd:enterStateAfterTransition";
}
public void doStepWhileInState(float delta)
{
super.doStepWhileInState(delta);
}
void TransitionDisplay(float delta) {
usableItemManager.step(delta);
invPanel.display(delta);
textManager.display(delta);
if (sceneLeaveTransition.enabled == true) {
sceneLeaveTransition.display();
} else if (sceneEnterTransition.enabled == true) {
sceneEnterTransition.display();
}
}
abstract void changeState(State state);
void changeStateEnd(State state) {
}
}
abstract class Scene extends State //<>// //<>// //<>// //<>//
{
PImage background;
String filename;
ImageButton[] imageButtons;
Scene( String backgroundFilename ) {
filename = backgroundFilename;
background = loadImage( filename );
}
void enterState( State oldState )
{
super.enterState(oldState);
if ( background == null ) {
background = loadImage( filename );
}
}
public void doStepWhileInState(float delta)
{
tint(255);
imageMode(CORNER);
image( background, 0, 0, width, height );
}
}