texture

package
v0.0.0-...-3626a0a Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2015 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Texture

type Texture struct {
	// contains filtered or unexported fields
}

Texture represents a 2D texture image.

func New

func New(srcPath string, offset, scale mgl64.Vec2) (*Texture, error)

New Creates and inializes a new texture from the given source, which may be either a local file path or URL to an image. If the path is empty a blank texture is returned. If the path is invalid an error is returned.

func NewEmpty

func NewEmpty(w, h int) (*Texture, error)

NewEmpty creates a new empty texture.

func (*Texture) ColorAt

func (t *Texture) ColorAt(uv mgl64.Vec2) color64.Color64

ColorAt takes normalized coordinates and returns the color linearly interpolated.

func (*Texture) SetColorAt

func (t *Texture) SetColorAt(uv mgl64.Vec2, c color64.Color64)

SetColorAt takes normalized coordinates and sets the color there to c, spreading it out reversed lineary interpolated.

Jump to

Keyboard shortcuts

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