Versions in this module Expand all Collapse all v0 v0.3.0 Dec 8, 2021 v0.2.4 Dec 6, 2021 Changes in this version type Animation + func (anim *Animation) ResetTime() + func (anim *Animation) SetFrame(n int) v0.2.3 Dec 6, 2021 v0.2.2 Dec 5, 2021 v0.2.1 Dec 4, 2021 v0.2.0 Dec 4, 2021 v0.1.0 Dec 1, 2021 Changes in this version + const DegToRad + const Epsilon + const MinNormal + const RadToDeg + var ALT = Modifier(0x0004) + var BoardA = Key(65) + var BoardApostrophe = Key(222) + var BoardArrowDown = Key(40) + var BoardArrowLeft = Key(37) + var BoardArrowRight = Key(39) + var BoardArrowUp = Key(38) + var BoardB = Key(66) + var BoardBackslash = Key(220) + var BoardBackspace = Key(8) + var BoardC = Key(67) + var BoardCapsLock = Key(20) + var BoardComma = Key(188) + var BoardD = Key(68) + var BoardDash = Key(189) + var BoardDelete = Key(46) + var BoardE = Key(69) + var BoardEight = Key(56) + var BoardEnd = Key(35) + var BoardEnter = Key(13) + var BoardEquals = Key(187) + var BoardEscape = Key(27) + var BoardF = Key(70) + var BoardF1 = Key(112) + var BoardF10 = Key(121) + var BoardF11 = Key(122) + var BoardF12 = Key(123) + var BoardF2 = Key(113) + var BoardF3 = Key(114) + var BoardF4 = Key(115) + var BoardF5 = Key(116) + var BoardF6 = Key(117) + var BoardF7 = Key(118) + var BoardF8 = Key(119) + var BoardF9 = Key(120) + var BoardFive = Key(53) + var BoardFour = Key(52) + var BoardG = Key(71) + var BoardH = Key(72) + var BoardHome = Key(36) + var BoardI = Key(73) + var BoardInsert = Key(45) + var BoardJ = Key(74) + var BoardK = Key(75) + var BoardL = Key(76) + var BoardLeftAlt = Key(18) + var BoardLeftBracket = Key(219) + var BoardLeftControl = Key(17) + var BoardLeftShift = Key(16) + var BoardLeftSuper = Key(73) + var BoardM = Key(77) + var BoardN = Key(78) + var BoardNine = Key(57) + var BoardNumAdd = Key(107) + var BoardNumDecimal = Key(110) + var BoardNumDivide = Key(111) + var BoardNumEight = Key(104) + var BoardNumEnter = Key(13) + var BoardNumFive = Key(101) + var BoardNumFour = Key(100) + var BoardNumLock = Key(144) + var BoardNumMultiply = Key(106) + var BoardNumNine = Key(105) + var BoardNumOne = Key(97) + var BoardNumSeven = Key(103) + var BoardNumSix = Key(102) + var BoardNumSubtract = Key(109) + var BoardNumThree = Key(99) + var BoardNumTwo = Key(98) + var BoardNumZero = Key(96) + var BoardO = Key(79) + var BoardOne = Key(49) + var BoardP = Key(80) + var BoardPageDown = Key(34) + var BoardPageUp = Key(33) + var BoardPause = Key(19) + var BoardPeriod = Key(190) + var BoardPrintScreen = Key(42) + var BoardQ = Key(81) + var BoardR = Key(82) + var BoardRightAlt = Key(18) + var BoardRightBracket = Key(221) + var BoardRightControl = Key(17) + var BoardRightShift = Key(16) + var BoardRightSuper = Key(73) + var BoardS = Key(83) + var BoardScrollLock = Key(145) + var BoardSemicolon = Key(186) + var BoardSeven = Key(55) + var BoardSix = Key(54) + var BoardSlash = Key(191) + var BoardSpace = Key(32) + var BoardT = Key(84) + var BoardTab = Key(9) + var BoardThree = Key(51) + var BoardTwo = Key(50) + var BoardU = Key(85) + var BoardV = Key(86) + var BoardW = Key(87) + var BoardX = Key(88) + var BoardY = Key(89) + var BoardZ = Key(90) + var BoardZero = Key(48) + var CONTROL = Modifier(0x0002) + var Files *Loader + var MOVE = Action(1) + var MouseLeft = Key(-1) + var MouseMiddle = Key(-3) + var MouseRight = Key(-2) + var NONE = Action(0) + var PRESS = Action(2) + var RELEASE = Action(3) + var REPEAT = Action(4) + var SHIFT = Modifier(0x0001) + var SUPER = Modifier(0x0008) + var Time *Clock + func CancelAnimationFrame(id int) — js/wasm + func CrossProduct(this, that Point) float32 + func DotProduct(this, that Point) float32 + func Exit() + func FloatEqual(a, b float32) bool + func FloatEqualThreshold(a, b, epsilon float32) bool + func Height() float32 + func LineTraceFraction(tracer, boundary Line) float32 + func LoadShader(vertSrc, fragSrc string) *webgl.Program + func MultiplyMatrixVector(m *Matrix, v []float32) []float32 + func Open(title string, width, height int, fullscreen bool, hideCursor bool, r Responder) + func RequestAnimationFrame(callback func(float32)) int — js/wasm + func SetBg(color uint32) + func Width() float32 + type AABB struct + Max Point + Min Point + type AABBer interface + AABB func() AABB + type Action int + type Animation struct + Current int + Delay time.Duration + Playing bool + Timer Timer + TotalFrames int + func NewAnimation(frames int, delay time.Duration) *Animation + func (anim *Animation) GetDelay() time.Duration + func (anim *Animation) GetFrame() int + func (anim *Animation) GetTotalFrames() int + func (anim *Animation) NextFrame() int + func (anim *Animation) Play(num int) + func (anim *Animation) SetDelay(d time.Duration) + func (anim *Animation) SetTotalFrames(total int) + func (anim *Animation) Stop() + type Assets struct — darwin/amd64, linux/amd64, windows/amd64 + func NewAssets() *Assets + func (a *Assets) Get(path string) Image + func (a *Assets) Image(path string) + func (a *Assets) Load(onFinish func()) + type Batch struct + func NewBatch(width, height float32) *Batch + func (b *Batch) Begin() + func (b *Batch) Draw(r Drawable, x, y, originX, originY, scaleX, scaleY, rotation float32, ...) + func (b *Batch) End() + func (b *Batch) SetProjection(width, height float32) + type BatchLine struct + func NewBatchLine(width, height float32) *BatchLine + func (b *BatchLine) Begin() + func (b *BatchLine) Draw(l Line, color uint32, transparency float32) + func (b *BatchLine) End() + func (b *BatchLine) SetProjection(width, height float32) + type Camera struct + Position Point + Viewport Point + Zoom float32 + func NewCamera(position, viewport Point) *Camera + func (cam *Camera) MoveTo(position Point) + func (cam *Camera) TranslateToScreen(position Point) Point + func (cam *Camera) TranslateToWorld(position Point) Point + type Clock struct + func NewClock() *Clock + func (c *Clock) Delta() float32 + func (c *Clock) Fps() float32 + func (c *Clock) Tick() + func (c *Clock) Time() float32 + type Container interface + Contains func(p Point) bool + type Drawable interface + Height func() float32 + Texture func() *webgl.Texture + View func() (float32, float32, float32, float32) + Width func() float32 + type Font struct + func NewGridFont(texture *Texture, cellWidth, cellHeight int) *Font + func (f *Font) Print(batch *Batch, text string, x, y float32, color uint32) + func (f *Font) Put(batch *Batch, r rune, x, y float32, color uint32) + func (f *Font) Remap(mapping string) + type Game struct + func (g *Game) Close() + func (g *Game) Key(key Key, modifier Modifier, action Action) + func (g *Game) Mouse(x, y float32, button Key, action Action) + func (g *Game) Preload() + func (g *Game) Render() + func (g *Game) Resize(w, h float32) + func (g *Game) Scroll(amount float32) + func (g *Game) Setup() + func (g *Game) Type(char rune) + func (g *Game) Update(dt float32) + type Image interface + Data func() interface{} + Height func() int + Width func() int + func LoadImage(data interface{}) Image + type ImageObject struct + func NewImageObject(img *image.NRGBA) *ImageObject + func (i *ImageObject) Data() interface{} + func (i *ImageObject) Height() int + func (i *ImageObject) Width() int + type Key int + type Line struct + P1 Point + P2 Point + func (l *Line) Angle() float32 + func (l *Line) AngleDeg() float32 + func (l *Line) Magnitude() float32 + func (l *Line) Normal() Point + func (l *Line) PointDistance(point Point) float32 + func (l *Line) PointDistanceSquared(point Point) float32 + func (l *Line) PointSide(point Point) bool + type Loader struct + func NewLoader() *Loader + func (l *Loader) Add(name, url string) + func (l *Loader) Image(name string) *Texture + func (l *Loader) Json(name string) string + func (l *Loader) Load(onFinish func()) + func (l *Loader) Sound(name string) *Sound + type Matrix struct + Val [9]float32 + func IdentityMatrix() *Matrix + func (m *Matrix) Identity() *Matrix + func (m *Matrix) Multiply(m2 *Matrix) *Matrix + func (m *Matrix) Rotate(deg float32) *Matrix + func (m *Matrix) RotateRad(rad float32) *Matrix + func (m *Matrix) RotationComponent() float32 + func (m *Matrix) RotationComponentRad() float32 + func (m *Matrix) Scale(x, y float32) *Matrix + func (m *Matrix) ScaleComponent() (x, y float32) + func (m *Matrix) Set(val []float32) *Matrix + func (m *Matrix) Translate(x, y float32) *Matrix + func (m *Matrix) TranslatePoint(p Point) *Matrix + func (m *Matrix) TranslationComponent() (x, y float32) + type Modifier int + type Point struct + X float32 + Y float32 + func LineIntersection(one, two Line) (Point, bool) + func (p *Point) Add(p2 Point) *Point + func (p *Point) AddScalar(s float32) *Point + func (p *Point) Equal(p2 Point) bool + func (p *Point) Multiply(p2 Point) *Point + func (p *Point) MultiplyMatrixVector(m *Matrix) *Point + func (p *Point) MultiplyScalar(s float32) *Point + func (p *Point) Normalize() (Point, float32) + func (p *Point) PointDistance(p2 Point) float32 + func (p *Point) PointDistanceSquared(p2 Point) float32 + func (p *Point) ProjectOnto(p2 Point) Point + func (p *Point) Set(x, y float32) *Point + func (p *Point) Subtract(p2 Point) *Point + func (p *Point) SubtractScalar(s float32) *Point + func (p Point) Within(c Container) bool + type Region struct + func NewRegion(texture *Texture, x, y, w, h int) *Region + func (r *Region) Height() float32 + func (r *Region) Texture() *webgl.Texture + func (r *Region) View() (float32, float32, float32, float32) + func (r *Region) Width() float32 + type Resource struct + type Responder interface + Close func() + Key func(key Key, modifier Modifier, action Action) + Mouse func(x, y float32, button Key, action Action) + Preload func() + Render func() + Resize func(width, height float32) + Scroll func(amount float32) + Setup func() + Type func(char rune) + Update func(dt float32) + type Sound struct + type Sprite struct + Alpha float32 + Anchor Point + Color uint32 + Position Point + Region *Region + Rotation float32 + Scale Point + func NewSprite(region *Region, x, y, scale float32) Sprite + func (s *Sprite) Height() float32 + func (s *Sprite) Render(batch *Batch, cam *Camera) + func (s *Sprite) Width() float32 + type Texture struct + func NewTexture(img Image) *Texture + func (r *Texture) View() (float32, float32, float32, float32) + func (t *Texture) Height() float32 + func (t *Texture) Texture() *webgl.Texture + func (t *Texture) Width() float32 + type Timer struct + ActiveDuration time.Duration + Begin time.Time + InactiveBegin time.Time + Run bool + func MakeTimer() Timer + func (t *Timer) Elapsed() time.Duration + func (t *Timer) Reset() + func (t *Timer) Start() + func (t *Timer) Stop() + type Trace struct + EndPosition Point + Fraction float32 + func LineTrace(tracer Line, boundaries []Line) Trace