func (self *Stage1) initGopher() { // add gopher sprite self.gopher.W = float32(140) self.gopher.H = float32(90) // put center of screen at start self.gopher.X = 1080 / 2 / 2 self.gopher.Y = 1920 / 2 / 2 tex_gopher := peer.GetGLPeer().LoadTexture("waza-gophers.jpeg", image.Rect(152, 10, 152+int(self.gopher.W), 10+int(self.gopher.H))) peer.GetGLPeer().AddSprite(&self.gopher, tex_gopher) }
func (self *Title) initialize() { // add background sprite self.background.W = float32(960) self.background.H = float32(540) // put center of screen self.background.X = 960 / 2 self.background.Y = 540 / 2 tex_background := peer.GetGLPeer().LoadTexture("title.png", image.Rect(0, 0, int(self.background.W), int(self.background.H))) peer.GetGLPeer().AddSprite(&self.background, tex_background) }
func (self *Simra) SetScene(driver Driver) { peer.LogDebug("IN") peer.GetGLPeer().Reset() peer.GetTouchPeer().RemoveAllTouchListener() self.driver = driver driver.Initialize() peer.LogDebug("OUT") }
func (self *Gomo) Initialize(onStart, onStop chan bool, updateCallback func()) { peer.LogDebug("IN") self.glPeer = peer.GetGLPeer() self.touchPeer = peer.GetTouchPeer() self.onStart = onStart self.onStop = onStop self.updateCallback = updateCallback peer.LogDebug("OUT") }
func (self *Simra) onStopped() { peer.LogDebug("IN") self.driver = nil peer.GetGLPeer().Finalize() peer.LogDebug("OUT") }