-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.ts
More file actions
44 lines (35 loc) · 1.39 KB
/
app.ts
File metadata and controls
44 lines (35 loc) · 1.39 KB
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
// Define a namespace for your project, so you don't have to prepend it to everything.
namespace example_project {
// This import is really just a convenience to avoid having to prepend user_interface_base
// Extensions and files are included when you list them inside pxt.json
import AppInterface = user_interface_base.AppInterface
import Scene = user_interface_base.Scene
import SceneManager = user_interface_base.SceneManager
// application configuration:
user_interface_base.getIcon = (id: string) => icons.get(id)
user_interface_base.resolveTooltip = (ariaId: string) => ariaId
export class App implements AppInterface {
sceneManager: SceneManager
constructor() {
// One interval delay to ensure all static constructors have executed.
basic.pause(5)
this.sceneManager = new SceneManager()
// Progress to the next scene if the arcade shield is present:
if (shieldhelpers.shieldPresent())
this.pushScene(new example_project.Home(this));
}
public pushScene(scene: Scene) {
this.sceneManager.pushScene(scene)
}
public popScene() {
this.sceneManager.popScene()
}
// These are just stubs to satisfy the AppInterface. You can implement them as needed:
public save(slot: string, buffer: Buffer): boolean {
return true;
}
public load(slot: string): Buffer {
return Buffer.create(0)
}
}
}