Documentation ¶
Index ¶
- type Render
- func (tr *Render) Bounds() pixel.Rect
- func (tr *Render) Color(at pixel.Vec) pixel.RGBA
- func (tr *Render) Draw(t pixel.Target, matrix pixel.Matrix)
- func (tr *Render) DrawColorMask(t pixel.Target, matrix pixel.Matrix, mask color.Color)
- func (tr *Render) Frame() *glhf.Frame
- func (tr *Render) Pixels() []uint8
- func (tr *Render) Render()
- func (tr *Render) ScreenShot() image.Image
- func (tr *Render) SetFragmentShaderPiece(main string)
- func (tr *Render) SetMovieMode(movieEnabled bool)
- func (tr *Render) SetTextureData(n int, img *image.NRGBA)
- func (tr *Render) SetUniformValue(name string, value interface{}) error
- func (tr *Render) StepMovieTime(seconds float32)
- func (tr *Render) Texture() *glhf.Texture
- func (tr *Render) UpdateMouse(x, y float32, clicked bool)
- type Texture
- func (t *Texture) Begin()
- func (t *Texture) End()
- func (t *Texture) Height() int
- func (t *Texture) ID() uint32
- func (t *Texture) Pixels(x, y, w, h int) []uint8
- func (t *Texture) SetPixels(x, y, w, h int, pixels []uint8)
- func (t *Texture) SetSmooth(smooth bool)
- func (t *Texture) Smooth() bool
- func (t *Texture) Width() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Render ¶
type Render struct {
// contains filtered or unexported fields
}
func MakeToyRender ¶
func (*Render) Draw ¶
Draw draws the content of the Canvas onto another Target, transformed by the given Matrix, just like if it was a Sprite containing the whole Canvas.
func (*Render) DrawColorMask ¶
DrawColorMask draws the content of the Canvas onto another Target, transformed by the given Matrix and multiplied by the given mask, just like if it was a Sprite containing the whole Canvas.
If the color mask is nil, a fully opaque white mask will be used causing no effect.
func (*Render) Pixels ¶
Pixels returns an alpha-premultiplied RGBA sequence of the content of the Canvas.
func (*Render) ScreenShot ¶
func (*Render) SetFragmentShaderPiece ¶
func (*Render) SetMovieMode ¶
func (*Render) SetUniformValue ¶
func (*Render) StepMovieTime ¶
func (*Render) Texture ¶
Texture returns the underlying OpenGL Texture of this Canvas.
Implements GLPicture interface.
func (*Render) UpdateMouse ¶
type Texture ¶
type Texture struct {
// contains filtered or unexported fields
}
Texture is an OpenGL texture.
func NewTexture ¶
NewTexture creates a new texture with the specified width and height with some initial pixel values. The pixels must be a sequence of RGBA values (one byte per component).
func (*Texture) Begin ¶
func (t *Texture) Begin()
Begin binds the Texture. This is necessary before using the Texture.
func (*Texture) End ¶
func (t *Texture) End()
End unbinds the Texture and restores the previous one.
func (*Texture) Pixels ¶
Pixels returns the content of a sub-region of the Texture as an RGBA byte sequence.
func (*Texture) SetPixels ¶
SetPixels sets the content of a sub-region of the Texture. Pixels must be an RGBA byte sequence.
func (*Texture) SetSmooth ¶
SetSmooth sets whether the Texture should be drawn "smoothly" or "pixely".
It affects how the Texture is drawn when zoomed. Smooth interpolates between the neighbour pixels, while pixely always chooses the nearest pixel.