Documentation ¶
Index ¶
- Constants
- Variables
- func AddElement(element UniqueRenderable, z float64) error
- func ChangeLayer(elem UniqueRenderable, z float64) error
- func Clear() error
- func FillScreen(r, g, b, a uint8) error
- func Fullscreen() error
- func LoadConf(filePath string) error
- func Quit() error
- func RemElement(element UniqueRenderable) (success bool)
- func Render() []error
- func SaveConf() error
- func SetDecoration(title string, iconPath string) error
- func SetDefaultConf() error
- func SetVirtualSize(size geo.Size) error
- func SetWindowSize(size geo.Size) error
- func Update() error
- func VSize() (geo.Size, error)
- func WindowSize() (geo.Size, error)
- func Windowed() error
- type Collection
- type Collidable
- type Font
- type Frame
- type GlyphMetrics
- type Positioned
- type Rect
- type Renderable
- type Runlevel
- type Sprite
- func LoadAnimatedSpriteFromFile(filename string, rects []sdl.Rect, delays []int) (*Sprite, error)
- func LoadAnimatedSpriteFromFiles(fileNames []string, delays []int) (*Sprite, error)
- func LoadAnimatedSpriteFromFrames(frames []*Frame, delays []int) (*Sprite, error)
- func LoadAnimatedSpriteFromTexture(frame *Frame) (*Sprite, error)
- func LoadSpriteFromFile(filename string) (*Sprite, error)
- func NewSprite() (*Sprite, error)
- type UniqueRenderable
Constants ¶
View Source
const ( USE_FRAME_COUNT = timerMode(iota) USE_TIME_PASSED )
View Source
const ( BLENDED = renderMethod(iota) SHADED SOLID )
Variables ¶
View Source
var ( RELEASED = buttonState{false, false} PRESSING = buttonState{true, true} PRESSED = buttonState{true, false} RELEASING = buttonState{false, true} )
View Source
var ( ConfigPath string AllowFrameSkipping bool DefaultSpriteTimerMode timerMode FramesVisibleOnLoad bool ResourcePath string SaveOnQuit bool UpdateOnRefresh bool Debug bool )
View Source
var Buttons mouseButtons
View Source
var ExitRequested bool
View Source
var Keyboard keyboardState
View Source
var Mouse mouseState
View Source
var Scancodes scancodeLookup
Functions ¶
func AddElement ¶
func AddElement(element UniqueRenderable, z float64) error
Adds an element to the zSpace.
func ChangeLayer ¶
func ChangeLayer(elem UniqueRenderable, z float64) error
func FillScreen ¶
func Fullscreen ¶
func Fullscreen() error
func RemElement ¶ added in v0.2.0
func RemElement(element UniqueRenderable) (success bool)
func SetDecoration ¶
func SetDefaultConf ¶ added in v0.1.1
func SetDefaultConf() error
func SetVirtualSize ¶
func SetWindowSize ¶
func WindowSize ¶
Types ¶
type Collection ¶
type Collection struct { Renderables []Renderable *geo.Location // contains filtered or unexported fields }
func EmptyCollection ¶ added in v0.1.1
func EmptyCollection() *Collection
func NewCollection ¶ added in v0.1.1
func NewCollection(renderables []Renderable) *Collection
func (*Collection) Add ¶ added in v0.1.1
func (c *Collection) Add(r Renderable)
func (*Collection) CollidesWith ¶
func (c *Collection) CollidesWith(obj2 Collidable) (bool, error)
func (*Collection) ID ¶ added in v0.1.1
func (c *Collection) ID() uniqueID.ID
func (*Collection) MoveRel ¶
func (c *Collection) MoveRel(v geo.Vec)
func (*Collection) MoveTo ¶
func (c *Collection) MoveTo(p geo.Point)
func (*Collection) Remove ¶ added in v0.1.1
func (c *Collection) Remove(r UniqueRenderable)
type Collidable ¶
type Font ¶
type Font struct { *ttf.Font Method renderMethod ColorRed uint8 ColorGreen uint8 ColorBlue uint8 ColorAlpha uint8 }
TODO: Add Size
func (*Font) GlyphMetrics ¶
func (f *Font) GlyphMetrics(char rune) (*GlyphMetrics, error)
type Frame ¶
func NewEmptyFrame ¶
type GlyphMetrics ¶
type GlyphMetrics ttf.GlyphMetrics
type Rect ¶
func (*Rect) HasMouseState ¶
type Renderable ¶
type Renderable interface {
// contains filtered or unexported methods
}
Finds usage also elsewhere
type Runlevel ¶
type Runlevel int32
const PAUSED Runlevel = 2
const RUNNING Runlevel = 1
const STOPPED Runlevel = 0
type Sprite ¶
type Sprite struct { Collection AllowFrameSkipping bool Delays []int FrameIndex int TimerMode timerMode Visible bool // contains filtered or unexported fields }
Sprites should only be initialized with NewSprite or the LoadSprite[…] functions
func LoadSpriteFromFile ¶
type UniqueRenderable ¶
type UniqueRenderable interface { Renderable ID() uniqueID.ID }
Click to show internal directories.
Click to hide internal directories.