MCPcopy
hub / github.com/go-qml/qml / Emit

Method Emit

examples/qrcpacking/main.go:68–82  ·  view source on GitHub ↗
(x, y int)

Source from the content-addressed store, hash-verified

66}
67
68func (ctrl *Control) Emit(x, y int) {
69 component := ctrl.Root.Object("emitterComponent")
70 for i := 0; i < 8; i++ {
71 emitter := component.Create(nil)
72 emitter.Set("x", x)
73 emitter.Set("y", y)
74 emitter.Set("targetX", rand.Intn(240)-120+x)
75 emitter.Set("targetY", rand.Intn(240)-120+y)
76 emitter.Set("life", rand.Intn(2400)+200)
77 emitter.Set("emitRate", rand.Intn(32)+32)
78 emitter.ObjectByName("xAnim").Call("start")
79 emitter.ObjectByName("yAnim").Call("start")
80 emitter.Set("enabled", true)
81 }
82}
83
84func (ctrl *Control) Done(emitter qml.Object) {
85 emitter.Destroy()

Callers 1

TextReleasedMethod · 0.95

Calls 5

ObjectMethod · 0.65
CreateMethod · 0.65
SetMethod · 0.65
CallMethod · 0.65
ObjectByNameMethod · 0.65

Tested by

no test coverage detected