sprite

package
v0.0.0-...-28fb5cd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2017 License: Apache-2.0 Imports: 11 Imported by: 26

Documentation

Overview

Package sprite manages images

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(path string) (image.Image, error)

Load

func LoadAsset

func LoadAsset(name string) (image.Image, error)

Types

type Context

type Context struct {
	ColorMap  image.Image
	NormalMap image.Image
	Width     int
	Height    int

	AmbientColorLoc int32
	AmbientColor    mgl32.Vec4
	LightPosLoc     int32
	LightColorLoc   int32
	LightPowerLoc   int32
	Light           light.Positional
	// contains filtered or unexported fields
}

Context TODO doc

func New

func New(colorMap, normalMap image.Image, framesX, framesY int) (*Context, error)

New TODO doc

func (*Context) Bind

func (c *Context) Bind(program uint32) error

Bind TODO doc

func (*Context) Draw

func (c *Context) Draw(pos mgl32.Vec3, e *Effects)

Draw TODO doc

func (*Context) DrawFrame

func (c *Context) DrawFrame(frame mgl32.Vec2, pos mgl32.Vec3, e *Effects)

DrawFrame TODO doc func (c *Context) DrawFrame(fx, fy int, sx, sy, px, py float32, addColor, subColor, ambientColor *mgl32.Vec4, light *light.Positional) {

func (*Context) Update

func (c *Context) Update(dt float32)

Update TODO doc

type Effects

type Effects struct {
	Scale          mgl32.Vec3
	Tint           mgl32.Vec4
	EnableLighting bool
	AmbientColor   mgl32.Vec4
	Light          light.Positional
}

type Sprite

type Sprite interface {
	Bind(prog uint32) error
	//Update(float32, []entity.Entity)
	Draw(pos mgl32.Vec3, efx *Effects)
}

Sprite TODO doc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL