Documentation ¶
Overview ¶
Package texture handles hardware accelerated image drawing. It uses a small subset of the features provided by the SFML library version 2.5 1.
Index ¶
- type Drawable
- func (dst *Drawable) Draw(dp image.Point, src wandi.Image) error
- func (dst *Drawable) DrawRect(dp image.Point, src wandi.Image, sr image.Rectangle) error
- func (dst *Drawable) Fill(c color.Color)
- func (tex *Drawable) Free()
- func (tex *Drawable) Height() int
- func (tex *Drawable) Image() (image.Image, error)
- func (tex *Drawable) Width() int
- type Image
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Drawable ¶
type Drawable struct {
// contains filtered or unexported fields
}
Drawable represent a drawable texture. It implements the wandi.Drawable and wandi.Image interfaces.
func LoadDrawable ¶
LoadDrawable loads the provided file and converts it into a drawable texture.
Note: The Free method of the texture must be called when finished using it.
func NewDrawable ¶
NewDrawable creates a drawable texture of the specified dimensions.
Note: The Free method of the texture must be called when finished using it.
func ReadDrawable ¶
ReadDrawable reads the provided image and converts it into a drawable texture.
Note: The Free method of the texture must be called when finished using it.
func (*Drawable) Draw ¶
Draw draws the entire src image onto the dst texture starting at the destination point dp.
func (*Drawable) DrawRect ¶
DrawRect draws a subset of the src image, as defined by the source rectangle sr, onto the dst texture starting at the destination point dp.
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
Image represent a read-only texture. It implements the wandi.Image interface.
func Load ¶
Load loads the provided file and converts it into a read-only texture.
Note: The Free method of the texture must be called when finished using it.