forked from Ezelia/EZGUI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscreen.html
50 lines (34 loc) · 1.41 KB
/
screen.html
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
<!DOCTYPE html>
<html>
<head>
<title>Window Example</title>
<script src="../../js/pixi4.dev.js"></script>
<script src="../../dist/EZGUI.js"></script>
</head>
<body>
<script>
var guiObj = {
//this ID must be unique, it'll help you easily access the gui component throught EZGUI.components.myWindow
id: 'myWindow',
//this the component ID, EZGUI define those components: Window, Button, Checkbox, Slider, Radio...
//but you can create your own components or extend existing
component: 'Window',
//This is the padding space from the component borders
padding: 4,
//component position relative to parent
position: { x: 10, y: 10 },
width: 500,
height: 500
}
var renderer = PIXI.autoDetectRenderer(820, 800);
document.body.appendChild(renderer.view);
var stage = new PIXI.Stage(0x000000);
var guiContainer;
//load EZGUI themes
//here you can pass multiple themes
EZGUI.Theme.load(['../../assets/kenney-theme/kenney-theme.json'], function () {
//create the gui
//the second parameter is the theme name, see kenney-theme.json, the name is defined under __config__ field
guiContainer = EZGUI.create(guiObj, 'kenney');
stage.addChild(guiContainer);
})