Documentation ¶
Index ¶
- Constants
- func ClearSurface(surf *gosdl.Surface)
- func ColorMap(color color.RGBA) uint32
- func FillRect(surf *gosdl.Surface, rect gosdl.Rect, color color.RGBA)
- func Init(xres, yres int, debug bool) (*EventMgr, *DisplayMgr)
- func LookupColor(tc lib.TileColor, p Palette) color.RGBA
- func MakeGrid(w, h int) *gosdl.Surface
- func NewSurface(w, h int) *gosdl.Surface
- func Rect(x, y, w, h int) gosdl.Rect
- type AudioMgr
- type BoardComponent
- type Component
- type DisplayMgr
- type EventMgr
- type Palette
Constants ¶
View Source
const CHUNK_SIZE = 4096
View Source
const H_MIN = 100
View Source
const SONG_PATH = "../assets/theme.ogg"
View Source
const W_MIN = 50
Variables ¶
This section is empty.
Functions ¶
func ClearSurface ¶
Clears the specified surface, by setting everything to the transparent color
func FillRect ¶
Helper function for coloring rectangles in surfaces. Allows us to use ordinary colors from image/color without hasslej
func Init ¶
func Init(xres, yres int, debug bool) (*EventMgr, *DisplayMgr)
Initializes SDL and starts everything related to it. This must be called before other managers are initialized, since they rely on the functionality here. Also listens for the quit event and exits if we attempt to close the window
Types ¶
type AudioMgr ¶
type AudioMgr struct{}
type BoardComponent ¶
type BoardComponent struct {
// contains filtered or unexported fields
}
func NewBoardComponent ¶
func (*BoardComponent) Draw ¶
func (bc *BoardComponent) Draw()
func (*BoardComponent) GetSurface ¶
func (bc *BoardComponent) GetSurface() *gosdl.Surface
func (*BoardComponent) Update ¶
func (bc *BoardComponent) Update(snap lib.GameSnapshot)
type Component ¶
type Component interface { GetSurface() *gosdl.Surface Draw() Update(lib.GameSnapshot) }
type DisplayMgr ¶
type DisplayMgr struct {
// contains filtered or unexported fields
}
func NewDisplayMgr ¶
func NewDisplayMgr(name string, xres, yres int) *DisplayMgr
func (*DisplayMgr) Add ¶
func (mgr *DisplayMgr) Add(comp Component)
func (*DisplayMgr) AddSurf ¶
func (mgr *DisplayMgr) AddSurf(s *gosdl.Surface)
func (*DisplayMgr) CreateWindow ¶
func (mgr *DisplayMgr) CreateWindow(xres, yres int)
func (*DisplayMgr) Render ¶
func (mgr *DisplayMgr) Render(snapshots chan lib.GameSnapshot)
Renders visuals to the screen
Click to show internal directories.
Click to hide internal directories.