Skip to content

Commit

Permalink
[godoc] add doc for pi.Load
Browse files Browse the repository at this point in the history
Add info how to acquire resources object.
  • Loading branch information
elgopher committed Aug 13, 2023
1 parent 73b20f3 commit eb6c4a2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pi.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ var Time float64
var GameLoopStopped bool

// Load loads files like sprite-sheet.png, custom-font.png
//
// Load looks for resources with specific names in the resources parameter, eg "sprite-sheet.png".
//
// To acquire the resources object, the easiest way is to include the resources in the game binary
// by using go:embed directive:
//
// package main
//
// // go:embed sprite-sheet.png
// var resources embed.FS
func Load(resources fs.ReadFileFS) {
if resources == nil {
return
Expand Down

0 comments on commit eb6c4a2

Please sign in to comment.