Documentation ¶
Overview ¶
Package graphic is using the sdl2 go interface from (c)https://github.com/veandco/go-sdl2/ under the BSD 3 License
Package graphic is using the sdl2 go interface from (c)https://github.com/veandco/go-sdl2/ under the BSD 3 License
Index ¶
- type Element
- type Graphic
- type Instance
- func (instance Instance) GetBaseHeight() float32
- func (instance Instance) GetBaseWitdth() float32
- func (instance *Instance) Hide()
- func (instance *Instance) IsHidden() bool
- func (instance *Instance) IsZoomed() bool
- func (instance *Instance) NewPosition(center sdl.FPoint)
- func (instance *Instance) NewPositionCorner(corner sdl.FPoint)
- func (instance *Instance) ResetZoom()
- func (instance *Instance) SetAngle(angle float64)
- func (instance *Instance) Show()
- func (instance *Instance) Zoom(multiplier float32)
- type List
- type Sprite
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Element ¶
type Element struct { Value *Instance // contains filtered or unexported fields }
Element of list only instance*
type Graphic ¶
type Graphic struct { Sprites []Sprite Renderer *sdl.Renderer // contains filtered or unexported fields }
Graphic contains the information required to render a window with diffrent Sprites
func New ¶
func New(title string, x, y, width, heigh int32, WindowFlags, RendererFlags uint32) (Graphic, error)
New returns a Graphic object with initialized renderer and window note that Sprites have to be added manual
func (*Graphic) AddSprite ¶
AddSprite adds another sprite which can be used be creating a instance of it see Sprite.NewInstance
func (*Graphic) RenderBoard ¶
func (graphic *Graphic) RenderBoard()
RenderBoard renders the information from the graphic object to the screen
func (*Graphic) RenderStack ¶
RenderStack renders one stack of cards
func (*Graphic) SetCardSpaces ¶
SetCardSpaces set the rectangle for card spaces
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
Instance position angle and the center of an instance of a sprite
func (Instance) GetBaseHeight ¶
GetBaseHeight returns the height of an unzommed instance
func (Instance) GetBaseWitdth ¶
GetBaseWitdth returns the width of an unzommed instance
func (*Instance) Hide ¶
func (instance *Instance) Hide()
Hide makes the instance invisible until Show
func (*Instance) NewPosition ¶
NewPosition sets the position of this instance center is the center of the instances new position
func (*Instance) NewPositionCorner ¶
NewPositionCorner sets the top left corner of the instance to corner
func (*Instance) ResetZoom ¶
func (instance *Instance) ResetZoom()
ResetZoom dRect.W, dRect.H is reset to default values
type List ¶
type List struct {
// contains filtered or unexported fields
}
List double linked list which can only store instances
type Sprite ¶
type Sprite struct {
// contains filtered or unexported fields
}
Sprite contains the texture a list of instances and a srcRect
func (*Sprite) NewInstance ¶
NewInstance adds a instance to the sprite and initializes the width and height of the dest rectangle with the src rectangle
func (*Sprite) ShowInstance ¶
ShowInstance makes instance visible