Sander Schobers
9641719579
Refactored event handling to be able to "handle" events so no other controls will handle the same event again.
23 lines
623 B
Go
23 lines
623 B
Go
package tins2020
|
|
|
|
import (
|
|
"opslag.de/schobers/tins2020/img"
|
|
|
|
"github.com/veandco/go-sdl2/sdl"
|
|
)
|
|
|
|
var Black = sdl.Color{R: 0, G: 0, B: 0, A: 255}
|
|
var Transparent = sdl.Color{R: 0, G: 0, B: 0, A: 0}
|
|
var TransparentWhite = sdl.Color{R: 255, G: 255, B: 255, A: 31}
|
|
var White = sdl.Color{R: 255, G: 255, B: 255, A: 255}
|
|
|
|
func MustHexColor(s string) sdl.Color { return sdl.Color(img.MustHexColor(s)) }
|
|
|
|
func SetDrawColor(renderer *sdl.Renderer, color sdl.Color) {
|
|
renderer.SetDrawColor(color.R, color.G, color.B, color.A)
|
|
}
|
|
|
|
func SetDrawColorHex(renderer *sdl.Renderer, s string) {
|
|
SetDrawColor(renderer, MustHexColor(s))
|
|
}
|