This repository has been archived by the owner on Feb 22, 2020. It is now read-only.
/
zzz_ArrayItem.go
61 lines (49 loc) · 1.5 KB
/
zzz_ArrayItem.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
// Code generated by docs2go. DO NOT EDIT.
package babylon
import (
"syscall/js"
)
// ArrayItem represents a babylon.js ArrayItem.
// Helper class for working with arrays when loading the glTF asset
type ArrayItem struct {
p js.Value
ctx js.Value
}
// JSObject returns the underlying js.Value.
func (a *ArrayItem) JSObject() js.Value { return a.p }
// ArrayItem returns a ArrayItem JavaScript class.
func (ba *Babylon) ArrayItem() *ArrayItem {
p := ba.ctx.Get("ArrayItem")
return ArrayItemFromJSObject(p, ba.ctx)
}
// ArrayItemFromJSObject returns a wrapped ArrayItem JavaScript class.
func ArrayItemFromJSObject(p js.Value, ctx js.Value) *ArrayItem {
return &ArrayItem{p: p, ctx: ctx}
}
// ArrayItemArrayToJSArray returns a JavaScript Array for the wrapped array.
func ArrayItemArrayToJSArray(array []*ArrayItem) []interface{} {
var result []interface{}
for _, v := range array {
result = append(result, v.JSObject())
}
return result
}
// ArrayItemAssignOpts contains optional parameters for ArrayItem.Assign.
type ArrayItemAssignOpts struct {
Array []*IArrayItem
}
// Assign calls the Assign method on the ArrayItem object.
//
// https://doc.babylonjs.com/api/classes/babylon.arrayitem#assign
func (a *ArrayItem) Assign(opts *ArrayItemAssignOpts) {
if opts == nil {
opts = &ArrayItemAssignOpts{}
}
args := make([]interface{}, 0, 0+1)
if opts.Array == nil {
args = append(args, js.Undefined())
} else {
args = append(args, IArrayItemArrayToJSArray(opts.Array))
}
a.p.Call("Assign", args...)
}