Documentation ¶
Index ¶
- func FileToB64(filename string) (string, error)
- type Wallpaper
- func (wp *Wallpaper) Corner() *image.RGBA
- func (wp *Wallpaper) CornerTexture(e render.Engine) (render.Texturer, error)
- func (wp *Wallpaper) Free() int
- func (wp *Wallpaper) Left() *image.RGBA
- func (wp *Wallpaper) LeftTexture(e render.Engine) (render.Texturer, error)
- func (wp *Wallpaper) QuarterRect() render.Rect
- func (wp *Wallpaper) QuarterSize() (int, int)
- func (wp *Wallpaper) Repeat() *image.RGBA
- func (wp *Wallpaper) RepeatTexture(e render.Engine) (render.Texturer, error)
- func (wp *Wallpaper) Top() *image.RGBA
- func (wp *Wallpaper) TopTexture(e render.Engine) (render.Texturer, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Wallpaper ¶
type Wallpaper struct { Name string Format string // image file format Image *image.RGBA // contains filtered or unexported fields }
Wallpaper is a repeatable background image to go behind levels.
func FromFile ¶
func FromFile(filename string, embeddable filesystem.Embeddable) (*Wallpaper, error)
FromFile creates a Wallpaper from a file on disk. If the renger.Engine is nil it will compute images but not pre-cache any textures yet.
func FromImage ¶
FromImage creates a Wallpaper from an image.Image. If the renger.Engine is nil it will compute images but not pre-cache any textures yet.
func (*Wallpaper) CornerTexture ¶
CornerTexture returns the Texture.
func (*Wallpaper) Free ¶
Free all SDL2 textures from memory.
The Canvas widget will free wallpaper textures in its Destroy method. Note that if the wallpaper was still somehow in use, the textures will be regenerated the next time a method like CornerTexture() asks for one.
Returns the number of textures freed (up to 4) or -1 if wallpaper was not ready.
func (*Wallpaper) LeftTexture ¶
LeftTexture returns the Texture.
func (*Wallpaper) QuarterRect ¶
QuarterRect returns a Rect of the size of the quarter images.
func (*Wallpaper) QuarterSize ¶
QuarterSize returns the width and height of the quarter images.
func (*Wallpaper) RepeatTexture ¶
RepeatTexture returns the Texture.