Documentation ¶
Index ¶
- Variables
- type AudioPlayer
- type Image
- type Line
- type Rect
- type Renderer2D
- func (r *Renderer2D) ClearColor(color [4]int)
- func (r *Renderer2D) DrawLine(x1, x2, y1, y2 float32, color [4]int)
- func (r *Renderer2D) DrawRect(x, y, width, height float32, color [4]int)
- func (r *Renderer2D) LoadImage(imagePath string, x, y, width, height float32) *Image
- func (r *Renderer2D) NewLine(x1, y1, x2, y2 float32, color [4]int) *Line
- func (r *Renderer2D) NewRect(x, y, width, height float32, color [4]int) *Rect
- type Vector2D
- type Vector3D
- type Window
Constants ¶
This section is empty.
Variables ¶
var ImageArray []uint32
Functions ¶
This section is empty.
Types ¶
type AudioPlayer ¶
type AudioPlayer struct { Streamer beep.StreamSeekCloser Format beep.Format File *os.File Done chan bool }
func OpenAudioFile ¶
func OpenAudioFile(filePath string) *AudioPlayer
Opens a audio file. It supports two file formats: WAV and MP3. Plays the audio file using Start function. Stop the audio file using Stop function. Close the audio file using Close function.
type Line ¶
type Line struct { Renderer *Renderer2D X1, Y1, X2, Y2 float32 Color [4]int }
type Rect ¶
type Rect struct { Renderer *Renderer2D X, Y, Width, Height float32 Color [4]int }
type Renderer2D ¶
type Renderer2D struct {
Window *Window
}
func (*Renderer2D) ClearColor ¶
func (r *Renderer2D) ClearColor(color [4]int)
Clears the screen whith the specific color that is provided
func (*Renderer2D) DrawLine ¶
func (r *Renderer2D) DrawLine(x1, x2, y1, y2 float32, color [4]int)
Draws a new line by the given x1, x2, y1, y2 and color
func (*Renderer2D) DrawRect ¶
func (r *Renderer2D) DrawRect(x, y, width, height float32, color [4]int)
Draws a new rect by the given x, y, width, height and color
func (*Renderer2D) LoadImage ¶
func (r *Renderer2D) LoadImage(imagePath string, x, y, width, height float32) *Image
Loads a new image and returns a Image struct. Can be later drawn using the Draw() method
type Vector2D ¶
func NewVector2D ¶
Creates a new 2D vector with x and y values
func SubtractVector2D ¶
Subtracts two 2D vectors from each other
type Vector3D ¶
func NewVector3D ¶
Creates a new 3D vector with x, y and z values
func SubtractVector3D ¶
Subtracts two 3D vectors from each other
type Window ¶
func (*Window) Close ¶
Function created for a loop. Returns true when being closed, and returns false when being active.
func (*Window) NewRenderer2D ¶
func (w *Window) NewRenderer2D() *Renderer2D
Creates a new renderer thats connected to the window.
func (*Window) Refresh ¶
func (w *Window) Refresh()
Refreshes te window. Run this at the end of your loop (except if you're having multiple windows)
func (*Window) SetContextCurrent ¶
func (w *Window) SetContextCurrent()
Sets the context of the window to the current context. (Only use when having multiple windows)
func (*Window) SetResizable ¶
Sets the resizable attribute of the window.