Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

22.
Slide URL: https://goo.gl/cIvTb5
Type restrictions
The Basics of Go Mobile / 22
● Signed integer and floating point type
● String and boolean type
● Byte slice type
● Any functions
○ parameter and result types must be supported types
○ results are 0, 1 or 2 (2nd result must be an error type)
● Any struct type
○ all fields and methods must be supported types
● Any interface
○ all methods must be supported types

34.
Slide URL: https://goo.gl/cIvTb5
How to render images
Go for Mobile Game / How to render images 34
● Construct a scene graph
○ exp/sprite package provides 2D scene graph
● Load a texture
○ asset package loads a image as a texture
● Set a sub-texture to a node
○ A node of scene graph can be set a sub-texture (part of
a texture)
● Render a scene graph
○ sprite.Engine type has Render method

66.
Slide URL: https://goo.gl/cIvTb5
How to call Android API from Go
Advanced Topics / How to call Android API from 66
● Call Android API through cgo by JNI
○ We should get JavaVM* object in own cgo code
● JavaVM* object is defined in Go Mobile inner
package as current_vm variable
○ x/mobile/internal/mobileinit/ctx_android.go
● We also use current_vm in own cgo code