Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var FastLoad bool
FastLoad skips the pesky loading of images and just makes a bunch of empty images When your asset library is large and you just want to test some basic logic.
View Source
var Scene = scene.Scene{ Start: func(ctx *scene.Context) { win := ctx.Window.(*oak.Window) ident, err := render.LoadSprite(filepath.Join("assets", "images", "raw", "ident.png")) if err == nil { ident.Modify(mod.ResizeToFit(400, 400, gift.CubicResampling)) identw, identh := ident.GetDims() ident.SetPos( float64(ctx.Window.Width())/2-float64(identw)/2, float64(ctx.Window.Height())/2-float64(identh)/2, ) ctx.DrawStack.Draw(ident, layers.StackBackground, layers.Back) } loadSheet, err := render.LoadSheet(filepath.Join("assets", "images", "32x32", "loading.png"), intgeom.Point2{32, 32}) if err == nil { loadingSeq, err = render.NewSheetSequence(loadSheet, 32, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0) loadingSeq.SetPos(float64(ctx.Window.Width()/2)-16, float64(ctx.Window.Height())-64) dlog.ErrorCheck(err) win.LoadingR = loadingSeq go ctx.DoAfter(2*time.Second, func() { ctx.DrawStack.Draw(loadingSeq, layers.StackBackground, layers.Back) }) } go func() { imageFolder := "assets/images" if FastLoad { dlog.ErrorCheck(render.BlankBatchLoad(imageFolder, 1000*500)) } else { dlog.ErrorCheck(render.BatchLoad(imageFolder)) } loadComplete++ }() go func() { if FastLoad { audio.BlankBatchLoad(filepath.Join("assets", "audio")) } else { audio.BatchLoad(filepath.Join("assets", "audio")) } sound.Init(1, 1, 1) loadComplete++ }() go func() { waitInProduction(ctx) loadComplete++ }() }, Loop: func() bool { return loadComplete < 3 }, End: func() (string, *scene.Result) { return scenes.Sample, &scene.Result{ Transition: scene.Fade(1, 20), NextSceneInput: nil, } }, }
Scene for managing loading and displaying something while we load.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.