Exemplo n.º 1
0
func main() {
	cc.Game.SetOnStart(func() {
		cc.Log("starts from main.go")
		cc.View().AdjustViewPort(true)
		cc.View().SetDesignResolutionSize(800, 450, cc.SHOW_ALL)
		cc.View().ResizeWithBrowserSize(true)

		cc.LoaderScene().Preload(resouces, func() {
			cc.Director().RunScene(NewHelloWorldScene())
		})
	})

	cc.Game.Run()
}
Exemplo n.º 2
0
func main() {
	cc.Game.SetOnStart(func() {
		cc.Log("starts from main.go", "begin tests")
		cc.View().AdjustViewPort(true)
		cc.View().SetDesignResolutionSize(800, 450, cc.SHOW_ALL)
		cc.View().ResizeWithBrowserSize(true)

		cc.LoaderScene().Preload(resources, func() {
			scene := cc.NewScene()
			scene.AddChild(test.NewTestController(testNames, resources).Layer)
			cc.Director().RunScene(scene)
		})
	})

	cc.Game.Run()
}