go-gfx

module
v0.0.0-...-624b60e Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: MIT

README

go-gfx Linux-Build Windows-Build Go Reference

Package gfx provides a simple native Go 2d graphics library for Windows and Linux.

Installation

Use the 'go' command:

$ go get github.com/taylorza/go-gfx

Examples

package main

import (
	"github.com/taylorza/go-gfx/pkg/gfx"
)

// Define a type that represents your application. This type must satisfy the Application interface
// and provide the Load, Update and Unload methods. This struct can maintain any additional state you
// require for your graphics application
type myapp struct {
}

// Load called once when the application is initialized
func (app *myapp) Load() {}

// Unload called when the application ends
func (app *myapp) Unload() {}

// Update called for every frame and provides the time in seconds since the last frame update
func (app *myapp) Update(delta float64) {
	// Update and draw your frame
	gfx.Clear(gfx.Cyan)
	gfx.DrawCircle(gfx.Width()/2, gfx.Height()/2, gfx.Height()/3, gfx.Red)
}

func main() {
	if gfx.Init("GFX Example", 0, 0, 320, 240, 2, 2) {
		gfx.Run(&myapp{})
	}
}

Directories

Path Synopsis
examples
additivewaves
Additive Waves - go-gfx implementation of demonstration presented on The Coding Train youtube channel 3.7: Additive Waves - The Nature of Code - https://www.youtube.com/watch?v=okfZRl4Xw-c
Additive Waves - go-gfx implementation of demonstration presented on The Coding Train youtube channel 3.7: Additive Waves - The Nature of Code - https://www.youtube.com/watch?v=okfZRl4Xw-c
pkg
gfx
Package gfx is a native graphics library for Go.
Package gfx is a native graphics library for Go.
gfx/animation
Package animation provides support for creating animations from sprite sheets.
Package animation provides support for creating animations from sprite sheets.
gfx/sprite
Package sprite adds some basic sprite support to the gfx package.
Package sprite adds some basic sprite support to the gfx package.

Jump to

Keyboard shortcuts

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