From eb6c4a285a380d4793b073585ae16018fd6ffda0 Mon Sep 17 00:00:00 2001 From: Jacek Olszak Date: Sun, 13 Aug 2023 08:22:07 +0200 Subject: [PATCH] [godoc] add doc for pi.Load Add info how to acquire resources object. --- pi.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pi.go b/pi.go index 3a5d519..fb5a486 100644 --- a/pi.go +++ b/pi.go @@ -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