vuelto

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

func (*AudioPlayer) Close

func (a *AudioPlayer) Close()

Closes the audio file.

func (*AudioPlayer) Start

func (a *AudioPlayer) Start()

Starts playing the audio file.

func (*AudioPlayer) Stop

func (a *AudioPlayer) Stop()

Stops playing the audio file.

type Image

type Image struct {
	Texture       uint32
	X, Y          float32
	Width, Height float32
}

func (*Image) Draw

func (img *Image) Draw()

Draws the image that's loaded before.

type Line

type Line struct {
	Renderer       *Renderer2D
	X1, Y1, X2, Y2 float32
	Color          [4]int
}

func (*Line) Draw

func (l *Line) Draw()

Draws the line loaded previously

type Rect

type Rect struct {
	Renderer            *Renderer2D
	X, Y, Width, Height float32
	Color               [4]int
}

func (*Rect) Draw

func (r *Rect) Draw()

Draws the rect loaded previously

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

func (*Renderer2D) NewLine

func (r *Renderer2D) NewLine(x1, y1, x2, y2 float32, color [4]int) *Line

Loads a new line and returns a Line struct. Can be later drawn using Draw() method

func (*Renderer2D) NewRect

func (r *Renderer2D) NewRect(x, y, width, height float32, color [4]int) *Rect

Loads a new rect and returns a Rect struct. Can be later drawn using Draw() method

type Vector2D

type Vector2D struct {
	X float64
	Y float64
}

func AddVector2D

func AddVector2D(v1, v2 Vector2D) *Vector2D

Adds two 2D vectors together

func NewVector2D

func NewVector2D(x, y float64) *Vector2D

Creates a new 2D vector with x and y values

func SubtractVector2D

func SubtractVector2D(v1, v2 Vector2D) *Vector2D

Subtracts two 2D vectors from each other

type Vector3D

type Vector3D struct {
	X float64
	Y float64
	Z float64
}

func AddVector3D

func AddVector3D(v1, v2 Vector3D) *Vector3D

Adds two 3D vectors together

func NewVector3D

func NewVector3D(x, y, z float64) *Vector3D

Creates a new 3D vector with x, y and z values

func SubtractVector3D

func SubtractVector3D(v1, v2 Vector3D) *Vector3D

Subtracts two 3D vectors from each other

type Window

type Window struct {
	Window        *glfw.Window
	Title         string
	Width, Height int
}

func NewWindow

func NewWindow(title string, width, height int, resizable bool) *Window

Creates a new window and returns a Window struct.

func (*Window) Close

func (w *Window) Close() bool

Function created for a loop. Returns true when being closed, and returns false when being active.

func (*Window) Destroy

func (w *Window) Destroy()

Destroys the window and cleans up the memory.

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

func (w *Window) SetResizable(resizable bool)

Sets the resizable attribute of the window.

Jump to

Keyboard shortcuts

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