Image

package
v0.0.0-...-48b4d52 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetImageSection

func GetImageSection(path string) *aggregateImageSection

GetImageSEction returns the image section based on named image

func GetUVFromPosition

func GetUVFromPosition(point image.Point) (u, v float32)

func LoadImages

func LoadImages(path string)
  • NewAggregateImage *
  • Walk the directory and aggregate all images to one image and store in meemory
  • @param {[type]} location string [description]

func NewBuddyAggregator

func NewBuddyAggregator(maxBounds int) *partition

NewBuddyAggregator creates a new partition which recursively finds free space in any aggregate image

Types

type AggregateImage

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

AggregateImage is our class for grouping all images, sprites, etc. into one place. This will improve performance over loading an image every time it's needed. Instead we only need to select a space of our pre-rendered composite image

func (*AggregateImage) Print

func (this *AggregateImage) Print(path string)

type Color

type Color struct {
	R, G, B, A float32
}

Color represents floating point unit color 0 to 1

type FontImage

type FontImage struct {
	Image
	R rune
}

func NewFontImage

func NewFontImage(font string, r rune) (retImg FontImage, err error)

creates a new font rune image TODO create interface ImageSection that has a "recursive" getSection function

func (*FontImage) VertexData

func (this *FontImage) VertexData() *Opengl.OpenGLVertexInfo

type FontImageSection

type FontImageSection struct {
	FontSections map[rune]image.Rectangle
	// contains filtered or unexported fields
}

FontImageSection keeps track of where our fonts are within the aggregate image

func GetFontImageSection

func GetFontImageSection(font string) *FontImageSection

GetFontImageSection returns FontImageSection based on named font

type Image

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

func NewImage

func NewImage(path string) (retImg Image, err error)

creates a new image

func (Image) Bounds

func (this Image) Bounds() image.Rectangle

Bounds will "override" the normal image bounds

func (*Image) SubImage

func (this *Image) SubImage(bounds image.Rectangle) (Image, error)

returns a new image that is just a sub image based on given bounds

func (*Image) VertexData

func (this *Image) VertexData() *Opengl.OpenGLVertexInfo

type SpriteSheetImage

type SpriteSheetImage struct {
	Image
	// contains filtered or unexported fields
}

SpriteSheetImage TODO: may be useful for sprite grouping in aggregate, SpriteRenderer will handle animations though

Jump to

Keyboard shortcuts

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