10 examples of 'godot get scene root' in Go

Every line of 'godot get scene root' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Go code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
559func (o *SceneTree) GetRoot() ViewportImplementer {
560 //log.Println("Calling SceneTree.GetRoot()")
561
562 // Build out the method's arguments
563 ptrArguments := make([]gdnative.Pointer, 0, 0)
564
565 // Get the method bind
566 methodBind := gdnative.NewMethodBind("SceneTree", "get_root")
567
568 // Call the parent method.
569 // Viewport
570 retPtr := gdnative.NewEmptyObject()
571 gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)
572
573 // If we have a return type, convert it from a pointer into its actual object.
574 ret := newViewportFromPointer(retPtr)
575
576 // Check to see if we already have an instance of this object in our Go instance registry.
577 if instance, ok := InstanceRegistry.Get(ret.GetBaseObject().ID()); ok {
578 return instance.(ViewportImplementer)
579 }
580
581 // Check to see what kind of class this is and create it. This is generally used with
582 // GetNode().
583 className := ret.GetClass()
584 if className != "Viewport" {
585 actualRet := getActualClass(className, ret.GetBaseObject())
586 return actualRet.(ViewportImplementer)
587 }
588
589 return &ret
590}
890func (o *AnimationPlayer) SetRoot(path gdnative.NodePath) {
891 //log.Println("Calling AnimationPlayer.SetRoot()")
892
893 // Build out the method's arguments
894 ptrArguments := make([]gdnative.Pointer, 1, 1)
895 ptrArguments[0] = gdnative.NewPointerFromNodePath(path)
896
897 // Get the method bind
898 methodBind := gdnative.NewMethodBind("AnimationPlayer", "set_root")
899
900 // Call the parent method.
901 // void
902 retPtr := gdnative.NewEmptyVoid()
903 gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)
904
905}
158func (o *RayCast2D) GetCollider() object.Object {
159 log.Println("Calling RayCast2D.GetCollider()")
160
161 // Build out the method's arguments
162 ptrArguments := make([]gdnative.Pointer, 0, 0)
163
164 // Get the method bind
165 methodBind := gdnative.NewMethodBind("RayCast2D", "get_collider")
166
167 // Call the parent method.
168 // Object
169 retPtr := object.NewEmptyObject()
170 gdnative.MethodBindPtrCall(methodBind, o.GetOwner(), ptrArguments, retPtr)
171
172 // If we have a return type, convert it from a pointer into its actual object.
173 ret := object.NewObjectFromPointer(retPtr)
174
175 log.Println(" Got return value: ", ret)
176 return ret
177}
46func (o *Physics2DTestMotionResult) GetCollider() object.Object {
47 log.Println("Calling Physics2DTestMotionResult.GetCollider()")
48
49 // Build out the method's arguments
50 ptrArguments := make([]gdnative.Pointer, 0, 0)
51
52 // Get the method bind
53 methodBind := gdnative.NewMethodBind("Physics2DTestMotionResult", "get_collider")
54
55 // Call the parent method.
56 // Object
57 retPtr := object.NewEmptyObject()
58 gdnative.MethodBindPtrCall(methodBind, o.GetOwner(), ptrArguments, retPtr)
59
60 // If we have a return type, convert it from a pointer into its actual object.
61 ret := object.NewObjectFromPointer(retPtr)
62
63 log.Println(" Got return value: ", ret)
64 return ret
65}
122func (o *PackedScene) GetState() scenestate.SceneState {
123 log.Println("Calling PackedScene.GetState()")
124
125 // Build out the method's arguments
126 ptrArguments := make([]gdnative.Pointer, 0, 0)
127
128 // Get the method bind
129 methodBind := gdnative.NewMethodBind("PackedScene", "get_state")
130
131 // Call the parent method.
132 // SceneState
133 retPtr := scenestate.NewEmptySceneState()
134 gdnative.MethodBindPtrCall(methodBind, o.GetOwner(), ptrArguments, retPtr)
135
136 // If we have a return type, convert it from a pointer into its actual object.
137 ret := scenestate.NewSceneStateFromPointer(retPtr)
138
139 log.Println(" Got return value: ", ret)
140 return ret
141}
86func (o *Camera) GetCameraTransform() gdnative.Transform {
87 //log.Println("Calling Camera.GetCameraTransform()")
88
89 // Build out the method's arguments
90 ptrArguments := make([]gdnative.Pointer, 0, 0)
91
92 // Get the method bind
93 methodBind := gdnative.NewMethodBind("Camera", "get_camera_transform")
94
95 // Call the parent method.
96 // Transform
97 retPtr := gdnative.NewEmptyTransform()
98 gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)
99
100 // If we have a return type, convert it from a pointer into its actual object.
101 ret := gdnative.NewTransformFromPointer(retPtr)
102 return ret
103}
119func (o *PrimitiveMesh) SetMaterial(material material.Material) {
120 log.Println("Calling PrimitiveMesh.SetMaterial()")
121
122 // Build out the method's arguments
123 ptrArguments := make([]gdnative.Pointer, 1, 1)
124 ptrArguments[0] = gdnative.NewPointerFromObject(material.GetOwner())
125
126 // Get the method bind
127 methodBind := gdnative.NewMethodBind("PrimitiveMesh", "set_material")
128
129 // Call the parent method.
130 // void
131 retPtr := gdnative.NewEmptyVoid()
132 gdnative.MethodBindPtrCall(methodBind, o.GetOwner(), ptrArguments, retPtr)
133
134}
147func (o *RayCast2D) GetCollider() Object {
148 //log.Println("Calling RayCast2D.GetCollider()")
149
150 // Build out the method's arguments
151 ptrArguments := make([]gdnative.Pointer, 0, 0)
152
153 // Get the method bind
154 methodBind := gdnative.NewMethodBind("RayCast2D", "get_collider")
155
156 // Call the parent method.
157 // Object
158 retPtr := gdnative.NewEmptyObject()
159 gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)
160
161 // If we have a return type, convert it from a pointer into its actual object.
162 ret := NewObjectFromPointer(retPtr)
163 //log.Println(" Got return value: ", ret)
164 return ret
165}
221func (o *GeometryInstance) GetMaterialOverride() MaterialImplementer {
222 //log.Println("Calling GeometryInstance.GetMaterialOverride()")
223
224 // Build out the method's arguments
225 ptrArguments := make([]gdnative.Pointer, 0, 0)
226
227 // Get the method bind
228 methodBind := gdnative.NewMethodBind("GeometryInstance", "get_material_override")
229
230 // Call the parent method.
231 // Material
232 retPtr := gdnative.NewEmptyObject()
233 gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)
234
235 // If we have a return type, convert it from a pointer into its actual object.
236 ret := newMaterialFromPointer(retPtr)
237
238 // Check to see if we already have an instance of this object in our Go instance registry.
239 if instance, ok := InstanceRegistry.Get(ret.GetBaseObject().ID()); ok {
240 return instance.(MaterialImplementer)
241 }
242
243 // Check to see what kind of class this is and create it. This is generally used with
244 // GetNode().
245 className := ret.GetClass()
246 if className != "Material" {
247 actualRet := getActualClass(className, ret.GetBaseObject())
248 return actualRet.(MaterialImplementer)
249 }
250
251 return &ret
252}
79func (me *Camera) Scene() *Scene {
80 return Core.Libs.Scenes.get(me.sceneID)
81}

Related snippets