Documentation ¶
Index ¶
- Variables
- func DrawText(fontName string, text string, x int32, y int32, color sdl.Color, ...)
- func FloatToVolume(f float32) int
- func GetFont(name string) *ttf.Font
- func GetImageTexture(path string) *sdl.Texture
- func InitializeClientComponents()
- func LoadFont(name string, size int, path string) *ttf.Font
- func PlayMusic(path string)
- func RegisterAudioCategory(name string, volume int)
- func RegisterFont(name string, size int, path string)
- func RegisterGuiComponent(init func())
- func RegisterScene(name string, scene Scene)
- func RunClient(onGUIReady func())
- func RunGUI(onGUIReady func(), done chan bool, input *Input) bool
- func UninitializeClientComponents()
- func UnloadFonts()
- type BaseScene
- type BaseSceneComponent
- type GUI
- func (g *GUI) Destroy()
- func (g *GUI) DrawText(fontName string, text string, x int32, y int32, color sdl.Color)
- func (g *GUI) GetSize() (int32, int32)
- func (g *GUI) ProcessEvents()
- func (g *GUI) RenderScene()
- func (g *GUI) Run(done chan bool)
- func (g *GUI) SetFrameStart()
- func (g *GUI) SetScene(name string)
- func (g *GUI) Stop()
- func (g *GUI) WaitAndSync()
- type Image
- type Input
- type Scene
- type SceneComponent
- type Sound
- type Text
Constants ¶
This section is empty.
Variables ¶
View Source
var AUDIO_ASSETS = "../assets/audio"
View Source
var AUDIO_CATEGORIES map[string]int = map[string]int{}
View Source
var IMAGE_ASSETS = "../assets/images"
Functions ¶
func FloatToVolume ¶
func GetImageTexture ¶
func InitializeClientComponents ¶
func InitializeClientComponents()
func RegisterAudioCategory ¶
func RegisterFont ¶
func RegisterGuiComponent ¶
func RegisterGuiComponent(init func())
func RegisterScene ¶
func UninitializeClientComponents ¶
func UninitializeClientComponents()
func UnloadFonts ¶
func UnloadFonts()
Types ¶
type BaseScene ¶
type BaseScene struct { Initialized bool ComponentList []SceneComponent }
func NewBaseScene ¶
func NewBaseScene() *BaseScene
func (*BaseScene) AddComponent ¶
func (b *BaseScene) AddComponent(component SceneComponent)
func (*BaseScene) InitComponents ¶
func (b *BaseScene) InitComponents()
func (*BaseScene) RenderComponents ¶
func (b *BaseScene) RenderComponents()
type BaseSceneComponent ¶
type BaseSceneComponent struct { }
func NewBaseSceneComponent ¶
func NewBaseSceneComponent() BaseSceneComponent
func (*BaseSceneComponent) KeyDown ¶
func (b *BaseSceneComponent) KeyDown(code sdl.Keycode)
func (*BaseSceneComponent) KeyPress ¶
func (b *BaseSceneComponent) KeyPress(code sdl.Keycode)
func (*BaseSceneComponent) KeyUp ¶
func (b *BaseSceneComponent) KeyUp(code sdl.Keycode)
type GUI ¶
type GUI struct { Running bool Events chan sdl.Event Scene Scene Window *sdl.Window Renderer *sdl.Renderer Input *Input Reload bool Width int32 Height int32 // contains filtered or unexported fields }
func (*GUI) ProcessEvents ¶
func (g *GUI) ProcessEvents()
func (*GUI) RenderScene ¶
func (g *GUI) RenderScene()
func (*GUI) SetFrameStart ¶
func (g *GUI) SetFrameStart()
func (*GUI) WaitAndSync ¶
func (g *GUI) WaitAndSync()
type Input ¶
func (*Input) ProcessEvent ¶
func (*Input) RecordKeyPress ¶
func (i *Input) RecordKeyPress(event *sdl.KeyUpEvent)
type Scene ¶
type SceneComponent ¶
Click to show internal directories.
Click to hide internal directories.