splish

package module
v0.0.0-...-a690e8b Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2015 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyEvent

type KeyEvent struct {
	IsDown bool
	Key    interface{}
}

type Layer2d

type Layer2d struct {
	Sprites   []SpriteInstance
	Transform image.Rectangle
}

type MouseKeyEvent

type MouseKeyEvent struct {
}

type MouseMoveEvent

type MouseMoveEvent struct {
}

type Point

type Point struct {
	X, Y float32
}

func NewPoint

func NewPoint(ip image.Point) Point

func (Point) Add

func (p Point) Add(s Point) Point

func (*Point) AddXY

func (p *Point) AddXY(x, y float32) Point

func (Point) ToImage

func (p Point) ToImage() image.Point

type Rectangle

type Rectangle struct {
	Min, Max Point
}

func NewRectangle

func NewRectangle(ir image.Rectangle) Rectangle

func (Rectangle) Empty

func (r Rectangle) Empty() bool

func (Rectangle) Overlaps

func (r Rectangle) Overlaps(s Rectangle) bool

func (Rectangle) Size

func (r Rectangle) Size() Point

func (Rectangle) ToImage

func (r Rectangle) ToImage() image.Rectangle

type Region

type Region struct {
	// Regions are drawn starting with low priority
	At       Point
	Priority int
	Scene    *SubScene
	Area     Rectangle
}

type Scene

type Scene struct {
	// Foreground is the highest level SubScene
	Foreground *SubScene
	// Background is the lowest level SubScene
	Background *SubScene

	Sprites []Sprite
	// contains filtered or unexported fields
}

func NewScene

func NewScene(w Window) Scene

func (*Scene) Draw

func (s *Scene) Draw()

func (*Scene) NewSprite

func (s *Scene) NewSprite(img image.Image) *Sprite

func (*Scene) TranslateView

func (s *Scene) TranslateView(x, y float32)

func (*Scene) ZoomView

func (s *Scene) ZoomView(z int)

type SizeEvent

type SizeEvent image.Rectangle

type Sprite

type Sprite struct {
	Tex  Texture
	Img  *image.RGBA
	Size Point
	Sub  []interface{}
}

func (*Sprite) SubSprite

func (s *Sprite) SubSprite(rect Rectangle) int

type SpriteID

type SpriteID int

type SpriteInstance

type SpriteInstance struct {
	Sprite   SpriteID
	Location Point
	Index    int
	Rotation int
	Scale    float32
}

type SubScene

type SubScene struct {
	Global   bool
	Location Point
	Layers   []Layer2d
}

type Texture

type Texture interface {
	Expire()
	MarkSubTexture(Rectangle) interface{}
}

type Window

type Window interface {
	Draw([]*SubScene, Rectangle)

	UploadTexture(*image.RGBA) Texture
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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