gui

package
v0.0.0-...-cc2b2c0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Colors = [6][3]float64{
	{0.929, 0.200, 0.231},
	{1.000, 0.639, 0.282},
	{0.341, 0.890, 0.537},
	{0.384, 0.627, 0.917},
	{0.752, 0.380, 0.796},
	{0.964, 0.960, 0.956},
}

6 colors represented as RGB values between 0 and 1

Functions

func ClearCode

func ClearCode(pos *int, grid *gtk.Grid, code *[4]int)

Replace circle `pos` from grid with empty label. Set code element `pos` to -1

func GameEnd

func GameEnd(gui *GuiElements, gs *GameState)

Remove gaming field

func SetClicked

func SetClicked(color int, code *[4]int, pos *int, gridPtr **gtk.Grid, ok *gtk.Button) func(button *gtk.DrawingArea, e *gdk.Event) bool

Set element `pos` of `code` to `color`. Create circle with `color` in `gridPtr`. Activate `ok` button if `pos` reached 4

func SetColor

func SetColor(R float64, G float64, B float64) func(da *gtk.DrawingArea, cr *cairo.Context) bool

Set color of drawing area

func StartGame

func StartGame(gui *GuiElements, gs *GameState)

Types

type ErrorHandlingBuilder

type ErrorHandlingBuilder struct{ *gtk.Builder }

func (*ErrorHandlingBuilder) MustGetObject

func (b *ErrorHandlingBuilder) MustGetObject(id string) glib.IObject

Helper that panics if object was not found Reduces iferr boilerplate when preset objects are loaded once and are not destroyed

type GameState

type GameState struct {
	// contains filtered or unexported fields
}

func (*GameState) Default

func (gs *GameState) Default()

type GuiElements

type GuiElements struct {
	// contains filtered or unexported fields
}

func BuildGui

func BuildGui() (gui *GuiElements)

Create GUI struct and bind basic function, like closing

Jump to

Keyboard shortcuts

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