Documentation ¶
Overview ¶
============================================================= log.go ------------------------------------------------------------- Various logging functions =============================================================
Index ¶
- func Clamp(value, min, max float64) float64
- func Debug(msg string, vars ...interface{})
- func DebugPxPoint(x, y float64, renderer pixel.Target)
- func Error(msg string, vars ...interface{})
- func GetAlpha(f float64) uint8
- func HexToColor(hex string) (c color.RGBA)
- func LoadAnimationsFromCSV(descPath string, spriteFrames []pixel.Rect) map[string][]pixel.Rect
- func LoadAsFrames(imgSprite pixel.Picture, w, h float64) []pixel.Rect
- func LoadAsFramesFromTop(imgSprite pixel.Picture, w, h float64) []pixel.Rect
- func LoadPicture(path string) (pixel.Picture, error)
- func LoadSprite(path string) (*pixel.Sprite, *pixel.PictureData)
- func LoadTTF(path string, size float64) (font.Face, error)
- func MaxInt(a, b int) int
- func MinInt(a, b int) int
- func PanicIfErr(err error)
- func PrintMemoryUsage()
- func RandFloat(min, max float64) float64
- func RandInt(min, max int) int
- func Warning(msg string, vars ...interface{})
- type UV
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clamp ¶
Clamp restricts a number to a certain range. If a value is too high, it’s reduced to the maximum. If it’s too low, it’s increased to the minimum.
func DebugPxPoint ¶
func LoadAnimationsFromCSV ¶
LoadAnimationFromCSV to set image sprite frames to good use, load them as set of animations csv file: Front,0,0 FrontBlink,1,1 LookUp,2,2 Left,3,7 LeftRight,4,6 LeftBlink,7,7 Walk,8,15 Run,16,23 Jump,24,26
e.g. animations = LoadAnimationFromCSV("./animations.csv", LoadAsFrames())
func LoadAsFramesFromTop ¶
func LoadSprite ¶
func LoadSprite(path string) (*pixel.Sprite, *pixel.PictureData)
LoadSprite load TMX tile image source
func PanicIfErr ¶
func PanicIfErr(err error)
func PrintMemoryUsage ¶
func PrintMemoryUsage()