Documentation ¶
Index ¶
- func Box1(x int, y int, width int, height int, renderer *sdl.Renderer, ...)
- func CopyArray[T any](in []T) []T
- func CopyTexture(texture *sdl.Texture, renderer *sdl.Renderer, width int, height int, x int, ...) error
- func DrawEquilateralTriange(renderer *sdl.Renderer, x int, y int, size float64, angle float64, ...) error
- func Glow(start sdl.Color, end sdl.Color, speed float32, clock uint64) sdl.Color
- func InterpolateColor(start sdl.Color, end sdl.Color, steps int, step int) sdl.Color
- func Reverse[T any](in []T)
- func TextWidth(font *ttf.Font, text string) int
- func WriteFont(font *ttf.Font, renderer *sdl.Renderer, x int, y int, message string, ...) error
- type Coordinates
- type GuiRenderer
- type PixelFormat
- type RenderFunction
- type RenderInfo
- type RenderLayer
- type RenderLayerList
- type RenderManager
- func (manager *RenderManager) AddLayer(layer RenderLayer)
- func (manager *RenderManager) RemoveByIndex(index int)
- func (manager *RenderManager) RemoveLayer(remove RenderLayer)
- func (manager *RenderManager) RenderAll(info RenderInfo) error
- func (manager *RenderManager) Replace(index int, layer RenderLayer)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Box1 ¶
draw a box that clips everything drawn inside of it by the bounds. the box has a 1px white border around it
func CopyTexture ¶
func DrawEquilateralTriange ¶
func Glow ¶
smoothly interpolate between two colors. clock should be a monotonically increasing value. * speed governs how fast the change will take place where speed=2 will quickly bounce back and * forth between the two colors and speed>2 will interpolate at a slower pace. * speed is a period such that after 'speed' clocks the color will return to the start color. * thus, at half a period the color will be the end color.
func InterpolateColor ¶
smoothly interpolate from start to end given a maximum of steps. if step > steps, then the color * will just be the end color.
Types ¶
type Coordinates ¶
func (Coordinates) MaxX ¶
func (coords Coordinates) MaxX() int
func (Coordinates) MaxY ¶
func (coords Coordinates) MaxY() int
func (Coordinates) X ¶
func (coords Coordinates) X(x int) int
func (Coordinates) Y ¶
func (coords Coordinates) Y(y int) int
type GuiRenderer ¶
type GuiRenderer func(coords Coordinates)
type PixelFormat ¶
type PixelFormat uint32
func FindPixelFormat ¶
func FindPixelFormat() PixelFormat
determine endianness of the host by comparing the least-significant byte of a 32-bit number * versus a little endian byte array * if the first byte in the byte array is the same as the lowest byte of the 32-bit number * then the host is little endian
type RenderFunction ¶
type RenderInfo ¶
type RenderLayer ¶
type RenderLayer interface { Render(RenderInfo) error ZIndex() int // order of the layer }
type RenderLayerList ¶
type RenderLayerList []RenderLayer
func (RenderLayerList) Len ¶
func (list RenderLayerList) Len() int
func (RenderLayerList) Swap ¶
func (list RenderLayerList) Swap(a int, b int)
type RenderManager ¶
type RenderManager struct { Layers RenderLayerList /* FIXME: maybe use the actor-style message passing loop instead of a lock */ Lock sync.Mutex }
func (*RenderManager) AddLayer ¶
func (manager *RenderManager) AddLayer(layer RenderLayer)
func (*RenderManager) RemoveByIndex ¶
func (manager *RenderManager) RemoveByIndex(index int)
func (*RenderManager) RemoveLayer ¶
func (manager *RenderManager) RemoveLayer(remove RenderLayer)
func (*RenderManager) RenderAll ¶
func (manager *RenderManager) RenderAll(info RenderInfo) error
func (*RenderManager) Replace ¶
func (manager *RenderManager) Replace(index int, layer RenderLayer)