This repository has been archived by the owner on Feb 22, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
zzz_XmlLoader.go
117 lines (91 loc) · 2.82 KB
/
zzz_XmlLoader.go
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
// Code generated by docs2go. DO NOT EDIT.
package babylon
import (
"syscall/js"
)
// XmlLoader represents a babylon.js XmlLoader.
// Class used to load GUI via XML.
type XmlLoader struct {
p js.Value
ctx js.Value
}
// JSObject returns the underlying js.Value.
func (x *XmlLoader) JSObject() js.Value { return x.p }
// XmlLoader returns a XmlLoader JavaScript class.
func (gui *GUI) XmlLoader() *XmlLoader {
p := gui.ctx.Get("XmlLoader")
return XmlLoaderFromJSObject(p, gui.ctx)
}
// XmlLoaderFromJSObject returns a wrapped XmlLoader JavaScript class.
func XmlLoaderFromJSObject(p js.Value, ctx js.Value) *XmlLoader {
return &XmlLoader{p: p, ctx: ctx}
}
// XmlLoaderArrayToJSArray returns a JavaScript Array for the wrapped array.
func XmlLoaderArrayToJSArray(array []*XmlLoader) []interface{} {
var result []interface{}
for _, v := range array {
result = append(result, v.JSObject())
}
return result
}
// NewXmlLoaderOpts contains optional parameters for NewXmlLoader.
type NewXmlLoaderOpts struct {
ParentClass js.Value
}
// NewXmlLoader returns a new XmlLoader object.
//
// https://doc.babylonjs.com/api/classes/babylon.gui.xmlloader#constructor
func (gui *GUI) NewXmlLoader(opts *NewXmlLoaderOpts) *XmlLoader {
if opts == nil {
opts = &NewXmlLoaderOpts{}
}
args := make([]interface{}, 0, 0+1)
args = append(args, opts.ParentClass)
p := gui.ctx.Get("XmlLoader").New(args...)
return XmlLoaderFromJSObject(p, gui.ctx)
}
// GetNodeById calls the GetNodeById method on the XmlLoader object.
//
// https://doc.babylonjs.com/api/classes/babylon.gui.xmlloader#getnodebyid
func (x *XmlLoader) GetNodeById(id string) js.Value {
args := make([]interface{}, 0, 1+0)
args = append(args, id)
retVal := x.p.Call("getNodeById", args...)
return retVal
}
// GetNodes calls the GetNodes method on the XmlLoader object.
//
// https://doc.babylonjs.com/api/classes/babylon.gui.xmlloader#getnodes
func (x *XmlLoader) GetNodes() js.Value {
retVal := x.p.Call("getNodes")
return retVal
}
// IsLoaded calls the IsLoaded method on the XmlLoader object.
//
// https://doc.babylonjs.com/api/classes/babylon.gui.xmlloader#isloaded
func (x *XmlLoader) IsLoaded() bool {
retVal := x.p.Call("isLoaded")
return retVal.Bool()
}
// LoadLayout calls the LoadLayout method on the XmlLoader object.
//
// https://doc.babylonjs.com/api/classes/babylon.gui.xmlloader#loadlayout
func (x *XmlLoader) LoadLayout(xmlFile JSObject, rootNode JSObject, callback JSObject) {
args := make([]interface{}, 0, 3+0)
if xmlFile == nil {
args = append(args, js.Null())
} else {
args = append(args, xmlFile.JSObject())
}
if rootNode == nil {
args = append(args, js.Null())
} else {
args = append(args, rootNode.JSObject())
}
if callback == nil {
args = append(args, js.Null())
} else {
args = append(args, callback.JSObject())
}
x.p.Call("loadLayout", args...)
}