Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FontContainer ¶
type FontContainer struct { // TODO Flyweight pattern re-use same fonts or add new Font *ttf.Font // contains filtered or unexported fields }
FontContainer data storage
func NewFontContainer ¶
func NewFontContainer() (*FontContainer, error)
NewFontContainer initialise new font container
func (*FontContainer) LoadFromFile ¶
func (f *FontContainer) LoadFromFile(d *FontData) (err error)
LoadFromFile a font
type FontData ¶
type FontData struct { sync.Mutex // ID unique name ID string // FontFilePath loaded once and cannot be changed later FontFilePath string // Size of font Size uint32 }
FontData that will be used for in scene
type TextureContainer ¶
type TextureContainer struct {
// contains filtered or unexported fields
}
TextureContainer data storage
func NewTexturesContainer ¶
func NewTexturesContainer(r *sdl.Renderer) *TextureContainer
NewTexturesContainer for loaded textures
func (*TextureContainer) Get ¶
func (t *TextureContainer) Get(d *TextureData) (*sdl.Texture, error)
Get texture by id
func (*TextureContainer) GetAll ¶
func (t *TextureContainer) GetAll() map[string]*sdl.Texture
GetAll all loaded textures
func (*TextureContainer) LoadFromFile ¶
func (t *TextureContainer) LoadFromFile(d *TextureData) error
LoadFromFile texture
type TextureData ¶
type TextureData struct { // ImageFilePath which will be used on screen ImageFilePath string // ID unique name ID string }
TextureData ...
Click to show internal directories.
Click to hide internal directories.