Documentation
¶
Index ¶
- Constants
- func ColorToHEX(color Color) uint32
- func ColorToRGBA(color Color) (r, g, b, a float32)
- type Animation
- type Batch
- func (batch *Batch) Begin()
- func (batch *Batch) Dispose()
- func (batch *Batch) Draw(texture *Texture, x, y, width, height float32)
- func (batch *Batch) DrawEx(texture *Texture, ...)
- func (batch *Batch) DrawRegion(region *TextureRegion, x, y, width, height float32)
- func (batch *Batch) DrawRegionEx(region *TextureRegion, ...)
- func (batch *Batch) End()
- func (batch *Batch) FillQuad(x1, y1, x2, y2, x3, y3, x4, y4 float32, color Color)
- func (batch *Batch) FillQuadEx(x1, y1 float32, c1 Color, x2, y2 float32, c2 Color, x3, y3 float32, c3 Color, ...)
- func (batch *Batch) FillRect(x, y, width, height float32, color Color)
- func (batch *Batch) FillRectEx(x, y, width, height float32, c1, c2, c3, c4 Color)
- func (batch *Batch) Flush()
- func (batch *Batch) GetColor() Color
- func (batch *Batch) Line(x1, y1, x2, y2 float32, color Color, stroke float32)
- func (batch *Batch) LineEx(x1, y1 float32, c1 Color, x2, y2 float32, c2 Color, stroke float32)
- func (batch *Batch) LineRect(x, y, width, height float32, color Color, stroke float32)
- func (batch *Batch) LineRectEx(x, y, originX, originY, width, height, scaleX, scaleY, rotation float32, ...)
- func (batch *Batch) PopTransform()
- func (batch *Batch) Push(texture *Texture, x1, y1 float32, c1 Color, u1, v1 float32, x2, y2 float32, ...)
- func (batch *Batch) PushTransform(transform mgl32.Mat3)
- func (batch *Batch) SetColor(color Color)
- func (batch *Batch) SetColorHEX(hex uint32)
- func (batch *Batch) SetColorRGBA(r, g, b, a float32)
- func (batch *Batch) SetProjection(projection mgl32.Mat4)
- type Camera
- func (camera *Camera) Project(input mgl32.Vec2, viewportX, viewportY, viewportWidth, viewportHeight float32) mgl32.Vec2
- func (camera *Camera) Resize(width, height float32)
- func (camera *Camera) Translate(x, y float32)
- func (camera *Camera) Unproject(input mgl32.Vec2, viewportX, viewportY, viewportWidth, viewportHeight float32) mgl32.Vec2
- func (camera *Camera) Update()
- type Color
- type Font
- type FrameBuffer
- type Shader
- func (s *Shader) Bind()
- func (s *Shader) Dispose()
- func (s *Shader) GetUniformLocation(name string) int32
- func (s *Shader) SetUniform1f(name string, value float32)
- func (s *Shader) SetUniform1i(name string, value int32)
- func (s *Shader) SetUniformMatrix4fv(name string, value *float32)
- func (s *Shader) Unbind()
- type Texture
- type TextureRegion
Constants ¶
View Source
const ( PositionSize = 2 ColorSize = 1 TexCoordSize = 2 VertexSize = PositionSize + ColorSize + TexCoordSize Stride = VertexSize * 4 )
Variables ¶
This section is empty.
Functions ¶
func ColorToHEX ¶
func ColorToRGBA ¶
Types ¶
type Animation ¶
type Animation struct {
Frames []*TextureRegion
FrameDuration float32
Loop bool
}
func NewAnimation ¶
func NewAnimation(frames []*TextureRegion, frameDuration float32, loop bool) *Animation
func (*Animation) GetFrame ¶
func (a *Animation) GetFrame(time float32) *TextureRegion
func (*Animation) IsFinished ¶
type Batch ¶
type Batch struct {
// contains filtered or unexported fields
}
func (*Batch) DrawRegion ¶
func (batch *Batch) DrawRegion(region *TextureRegion, x, y, width, height float32)
func (*Batch) DrawRegionEx ¶
func (batch *Batch) DrawRegionEx( region *TextureRegion, x, y, originX, originY, width, height, scaleX, scaleY, rotation float32, )
func (*Batch) FillQuadEx ¶
func (*Batch) FillRectEx ¶
func (*Batch) LineRectEx ¶
func (*Batch) PopTransform ¶
func (batch *Batch) PopTransform()
func (*Batch) PushTransform ¶
func (*Batch) SetColorHEX ¶
func (*Batch) SetColorRGBA ¶
func (*Batch) SetProjection ¶
type Camera ¶
type Camera struct {
Position mgl32.Vec2
Zoom float32
Width float32
Height float32
Matrix mgl32.Mat4
Inverse mgl32.Mat4
}
type Color ¶
type Color float32
const ( ColorClear Color = 0x0.0p0 ColorBlack Color = -0x1.0p125 ColorGray Color = -0x1.0101p126 ColorSilver Color = -0x1.6d6d6cp126 ColorWhite Color = -0x1.fffffep126 ColorRed Color = -0x1.0001fep125 ColorOrange Color = -0x1.00fffep125 ColorYellow Color = -0x1.01fffep125 ColorGreen Color = -0x1.01fep125 ColorBlue Color = -0x1.fep126 )
func ColorFromHEX ¶
func ColorFromRGBA ¶
type Font ¶
type Font struct {
// contains filtered or unexported fields
}
func (*Font) MeasureText ¶
type FrameBuffer ¶
type FrameBuffer struct {
// contains filtered or unexported fields
}
func NewFrameBuffer ¶
func NewFrameBuffer(width, height int32) (*FrameBuffer, error)
func (*FrameBuffer) Bind ¶
func (frameBuffer *FrameBuffer) Bind()
func (*FrameBuffer) Dispose ¶
func (frameBuffer *FrameBuffer) Dispose()
func (*FrameBuffer) GetColorTexture ¶
func (frameBuffer *FrameBuffer) GetColorTexture() *Texture
func (*FrameBuffer) Unbind ¶
func (frameBuffer *FrameBuffer) Unbind()
type Shader ¶
type Shader struct {
Program uint32
// contains filtered or unexported fields
}
func (*Shader) GetUniformLocation ¶
func (*Shader) SetUniform1f ¶
func (*Shader) SetUniform1i ¶
func (*Shader) SetUniformMatrix4fv ¶
type Texture ¶
func NewTexture ¶
type TextureRegion ¶
func NewTextureRegion ¶
func NewTextureRegion(texture *Texture) *TextureRegion
func (*TextureRegion) Flip ¶
func (r *TextureRegion) Flip(flipX, flipY bool)
func (*TextureRegion) SetBounds ¶
func (r *TextureRegion) SetBounds(x, y, width, height int32)
func (*TextureRegion) SetTexture ¶
func (r *TextureRegion) SetTexture(texture *Texture)
func (*TextureRegion) SetUV ¶
func (r *TextureRegion) SetUV(u, v, u2, v2 float32)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.