Documentation
¶
Index ¶
Constants ¶
View Source
const ( KeyUnknown = iota KeyUp KeyDown KeyLeft KeyRight KeyEsc KeySpace )
View Source
const ( KeyModNone = 0x0000 KeyModLshift = 0x0001 KeyModRshift = 0x0002 KeyModLctrl = 0x0040 KeyModRctrl = 0x0080 KeyModLalt = 0x0100 KeyModRalt = 0x0200 KeyModLgui = 0x0400 KeyModRgui = 0x0400 KeyModCaps = 0x2000 )
View Source
const ( KeyModAlt = KeyModLalt | KeyModRalt KeyModGui = KeyModLgui | KeyModRgui KeyModCtrl = KeyModLctrl | KeyModRctrl KeyModShift = KeyModLshift | KeyModRshift )
View Source
const ( MouseButtonDown = iota MouseButtonUp MouseWheel )
View Source
const ( ScreenScale4x3 = 200.0 / 240.0 ScreenScale16x9 = 200.0 / 234.0 )
View Source
const MaxVolume = mix.MAX_VOLUME
Variables ¶
View Source
var ( ErrFileNotFound = errors.New("file not found") ErrFadeMusic = errors.New("can't fadeout music") )
View Source
var ConfigPath string
View Source
var ScreenScale = ScreenScale4x3
Functions ¶
func CfgRootJoin ¶
Types ¶
type AudioPlayer ¶
type AudioPlayer interface { LoadMusic(name string, data []byte) error PlayMusic(name string, fade time.Duration, loops int) error FadeMusic(fade time.Duration) error IsPlayingMusic() bool IsPausedMusic() bool StopMusic() PauseMusic() ResumeMusic() VolumeMusic(vol int) int MusicCallback(cb func()) LoadSound(name string, data []byte) (Sound, error) Sound(name string) (Sound, error) StopChannel(channel int) IsPlayingChannel(channel int) bool FadeChannel(channel int, fade time.Duration) error VolumeChannel(channel, vol int) int ReserveChannels(num int) int ChannelCallback(cb func(int)) Shutdown() }
func NewAudioPlayer ¶
func NewAudioPlayer() (AudioPlayer, error)
type KeyDownEvent ¶
type KeyUpEvent ¶
type MouseButtonEvent ¶
type MouseButtonEvent struct {
X, Y, Button, Type int
}
type MouseMotionEvent ¶
type MouseMotionEvent struct {
X, Y, XRel, YRel int
}
type MouseState ¶
func Mouse ¶
func Mouse() MouseState
type Renderer ¶
type Renderer interface { Clear() Present() Shutdown() ToggleFullscreen() SetWindowTitle(title string) BackBuffer() draw.Image DrawRect(dest image.Rectangle, c color.Color, fill bool) BlitPaletted(dp image.Point, src *image.Paletted) BlitImage(dp image.Point, src *image.Paletted, pal color.Palette) Blit(dp image.Point, src *image.Paletted, sr image.Rectangle, pal color.Palette) }
func NewRenderer ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.