engi: github.com/ajhager/engi Index | Files | Directories

package engi

import "github.com/ajhager/engi"

Index

Package Files

assets.go batch.go clock.go engi.go engi_glfw.go font.go input.go responder.go

Variables

var (
    Time  *Clock
    Files *Loader
)
var (
    MOVE    = Action(0)
    PRESS   = Action(1)
    RELEASE = Action(2)
    REPEAT  = Action(3)
    SHIFT   = Modifier(0x0001)
    CONTROL = Modifier(0x0002)
    ALT     = Modifier(0x0004)
    SUPER   = Modifier(0x0008)
)
var (
    Dash         = Key(189)
    Apostrophe   = Key(222)
    Semicolon    = Key(186)
    Equals       = Key(187)
    Comma        = Key(188)
    Period       = Key(190)
    Slash        = Key(191)
    Backslash    = Key(220)
    Backspace    = Key(8)
    Tab          = Key(9)
    CapsLock     = Key(20)
    Space        = Key(32)
    Enter        = Key(13)
    Escape       = Key(27)
    Insert       = Key(45)
    PrintScreen  = Key(42)
    Delete       = Key(46)
    PageUp       = Key(33)
    PageDown     = Key(34)
    Home         = Key(36)
    End          = Key(35)
    Pause        = Key(19)
    ScrollLock   = Key(145)
    ArrowLeft    = Key(37)
    ArrowRight   = Key(39)
    ArrowDown    = Key(40)
    ArrowUp      = Key(38)
    LeftBracket  = Key(219)
    LeftShift    = Key(16)
    LeftControl  = Key(17)
    LeftSuper    = Key(73)
    LeftAlt      = Key(18)
    RightBracket = Key(221)
    RightShift   = Key(16)
    RightControl = Key(17)
    RightSuper   = Key(73)
    RightAlt     = Key(18)
    Zero         = Key(48)
    One          = Key(49)
    Two          = Key(50)
    Three        = Key(51)
    Four         = Key(52)
    Five         = Key(53)
    Six          = Key(54)
    Seven        = Key(55)
    Eight        = Key(56)
    Nine         = Key(57)
    F1           = Key(112)
    F2           = Key(113)
    F3           = Key(114)
    F4           = Key(115)
    F5           = Key(116)
    F6           = Key(117)
    F7           = Key(118)
    F8           = Key(119)
    F9           = Key(120)
    F10          = Key(121)
    F11          = Key(122)
    F12          = Key(123)
    A            = Key(65)
    B            = Key(66)
    C            = Key(67)
    D            = Key(68)
    E            = Key(69)
    F            = Key(70)
    G            = Key(71)
    H            = Key(72)
    I            = Key(73)
    J            = Key(74)
    K            = Key(75)
    L            = Key(76)
    M            = Key(77)
    N            = Key(78)
    O            = Key(79)
    P            = Key(80)
    Q            = Key(81)
    R            = Key(82)
    S            = Key(83)
    T            = Key(84)
    U            = Key(85)
    V            = Key(86)
    W            = Key(87)
    X            = Key(88)
    Y            = Key(89)
    Z            = Key(90)
    NumLock      = Key(144)
    NumMultiply  = Key(106)
    NumDivide    = Key(111)
    NumAdd       = Key(107)
    NumSubtract  = Key(109)
    NumZero      = Key(96)
    NumOne       = Key(97)
    NumTwo       = Key(98)
    NumThree     = Key(99)
    NumFour      = Key(100)
    NumFive      = Key(101)
    NumSix       = Key(102)
    NumSeven     = Key(103)
    NumEight     = Key(104)
    NumNine      = Key(105)
    NumDecimal   = Key(110)
    NumEnter     = Key(13)
)

func Exit Uses

func Exit()

func Height Uses

func Height() float32

func LoadShader Uses

func LoadShader(vertSrc, fragSrc string) *webgl.Program

func Open Uses

func Open(title string, width, height int, fullscreen bool, r Responder)

func SetBg Uses

func SetBg(color uint32)

func Width Uses

func Width() float32

type Action Uses

type Action int

type Assets Uses

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

func NewAssets Uses

func NewAssets() *Assets

func (*Assets) Get Uses

func (a *Assets) Get(path string) Image

func (*Assets) Image Uses

func (a *Assets) Image(path string)

func (*Assets) Load Uses

func (a *Assets) Load(onFinish func())

type Batch Uses

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

func NewBatch Uses

func NewBatch(width, height float32) *Batch

func (*Batch) Begin Uses

func (b *Batch) Begin()

func (*Batch) Draw Uses

func (b *Batch) Draw(r Drawable, x, y, originX, originY, scaleX, scaleY, rotation float32, color uint32, transparency float32)

func (*Batch) End Uses

func (b *Batch) End()

func (*Batch) SetProjection Uses

func (b *Batch) SetProjection(width, height float32)

type Clock Uses

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

func NewClock Uses

func NewClock() *Clock

func (*Clock) Delta Uses

func (c *Clock) Delta() float32

func (*Clock) Fps Uses

func (c *Clock) Fps() float32

func (*Clock) Tick Uses

func (c *Clock) Tick()

func (*Clock) Time Uses

func (c *Clock) Time() float32

type Drawable Uses

type Drawable interface {
    Texture() *webgl.Texture
    Width() float32
    Height() float32
    View() (float32, float32, float32, float32)
}

type Font Uses

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

func NewGridFont Uses

func NewGridFont(texture *Texture, cellWidth, cellHeight int) *Font

func (*Font) Print Uses

func (f *Font) Print(batch *Batch, text string, x, y float32, color uint32)

func (*Font) Put Uses

func (f *Font) Put(batch *Batch, r rune, x, y float32, color uint32)

func (*Font) Remap Uses

func (f *Font) Remap(mapping string)

type Game Uses

type Game struct{}

func (*Game) Close Uses

func (g *Game) Close()

func (*Game) Key Uses

func (g *Game) Key(key Key, modifier Modifier, action Action)

func (*Game) Mouse Uses

func (g *Game) Mouse(x, y float32, action Action)

func (*Game) Preload Uses

func (g *Game) Preload()

func (*Game) Render Uses

func (g *Game) Render()

func (*Game) Resize Uses

func (g *Game) Resize(w, h float32)

func (*Game) Scroll Uses

func (g *Game) Scroll(amount float32)

func (*Game) Setup Uses

func (g *Game) Setup()

func (*Game) Type Uses

func (g *Game) Type(char rune)

func (*Game) Update Uses

func (g *Game) Update(dt float32)

type Image Uses

type Image interface {
    Data() interface{}
    Width() int
    Height() int
}

func LoadImage Uses

func LoadImage(data interface{}) Image

type ImageObject Uses

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

func NewImageObject Uses

func NewImageObject(img *image.NRGBA) *ImageObject

func (*ImageObject) Data Uses

func (i *ImageObject) Data() interface{}

func (*ImageObject) Height Uses

func (i *ImageObject) Height() int

func (*ImageObject) Width Uses

func (i *ImageObject) Width() int

type Key Uses

type Key int

type Loader Uses

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

func NewLoader Uses

func NewLoader() *Loader

func (*Loader) Add Uses

func (l *Loader) Add(name, url string)

func (*Loader) Image Uses

func (l *Loader) Image(name string) *Texture

func (*Loader) Json Uses

func (l *Loader) Json(name string) string

func (*Loader) Load Uses

func (l *Loader) Load(onFinish func())

func (*Loader) Sound Uses

func (l *Loader) Sound(name string) *Sound

type Modifier Uses

type Modifier int

type Point Uses

type Point struct {
    X, Y float32
}

type Region Uses

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

func NewRegion Uses

func NewRegion(texture *Texture, x, y, w, h int) *Region

func (*Region) Height Uses

func (r *Region) Height() float32

func (*Region) Texture Uses

func (r *Region) Texture() *webgl.Texture

func (*Region) View Uses

func (r *Region) View() (float32, float32, float32, float32)

func (*Region) Width Uses

func (r *Region) Width() float32

type Resource Uses

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

type Responder Uses

type Responder interface {
    Render()
    Resize(width, height float32)
    Preload()
    Setup()
    Close()
    Update(dt float32)
    Mouse(x, y float32, action Action)
    Scroll(amount float32)
    Key(key Key, modifier Modifier, action Action)
    Type(char rune)
}

type Sound Uses

type Sound struct {
    *audio.Player
}

type Sprite Uses

type Sprite struct {
    Position *Point
    Scale    *Point
    Anchor   *Point
    Rotation float32
    Color    uint32
    Alpha    float32
    Region   *Region
}

func NewSprite Uses

func NewSprite(region *Region, x, y float32) *Sprite

func (*Sprite) Height Uses

func (s *Sprite) Height() float32

func (*Sprite) Render Uses

func (s *Sprite) Render(batch *Batch)

func (*Sprite) Width Uses

func (s *Sprite) Width() float32

type Texture Uses

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

func NewTexture Uses

func NewTexture(img Image) *Texture

func (*Texture) Height Uses

func (t *Texture) Height() float32

Height returns the height of the texture.

func (*Texture) Texture Uses

func (t *Texture) Texture() *webgl.Texture

func (*Texture) View Uses

func (r *Texture) View() (float32, float32, float32, float32)

func (*Texture) Width Uses

func (t *Texture) Width() float32

Width returns the width of the texture.

Directories

PathSynopsis
demos

Package engi imports 14 packages (graph) and is imported by 5 packages. Updated 2016-07-18. Refresh now. Tools for package owners.