Documentation
¶
Index ¶
- type TransformOperation
- type TransformOperationKind
- type TransformationStack
- func (s *TransformationStack) Append(op TransformOperation)
- func (s *TransformationStack) EnsureInitialLayer()
- func (s *TransformationStack) GeometryMatrix() ebiten.GeoM
- func (s *TransformationStack) Pull()
- func (s *TransformationStack) Push()
- func (s *TransformationStack) Rotate(angle float64)
- func (s *TransformationStack) Scale(x, y float64)
- func (s *TransformationStack) Translate(x, y float64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TransformOperation ¶
type TransformOperation struct {
// contains filtered or unexported fields
}
TransformOperation is a single transformation operation.
type TransformOperationKind ¶
type TransformOperationKind uint8
TransformOperationKind is the kind of a transformation operation.
const ( // TransformScale scales the coordinate axes. TransformScale TransformOperationKind = iota // TransformRotate rotates the coordinate system. TransformRotate // TransformTranslate moves the origin of the coordinate system. TransformTranslate )
type TransformationStack ¶
type TransformationStack struct {
// contains filtered or unexported fields
}
TransformationStack stores operations rather than transformed coordinates. Replaying them only when something is drawn avoids compounding rounding errors between drawing calls.
func NewTransformationStack ¶
func NewTransformationStack() TransformationStack
NewTransformationStack creates a new TransformationStack.
func (*TransformationStack) Append ¶
func (s *TransformationStack) Append(op TransformOperation)
Append appends a transformation operation to the most recent layer.
func (*TransformationStack) EnsureInitialLayer ¶
func (s *TransformationStack) EnsureInitialLayer()
EnsureInitialLayer ensures that the initial layer exists.
func (*TransformationStack) GeometryMatrix ¶
func (s *TransformationStack) GeometryMatrix() ebiten.GeoM
GeometryMatrix returns the transformation matrix.
func (*TransformationStack) Pull ¶
func (s *TransformationStack) Pull()
Pull removes the most recently pushed transformation layer.
func (*TransformationStack) Push ¶
func (s *TransformationStack) Push()
Push adds transformation layer to the stack.
func (*TransformationStack) Rotate ¶
func (s *TransformationStack) Rotate(angle float64)
Rotate rotates the coordinate system.
func (*TransformationStack) Scale ¶
func (s *TransformationStack) Scale(x, y float64)
Scale scales the coordinate axes.
func (*TransformationStack) Translate ¶
func (s *TransformationStack) Translate(x, y float64)
Translate moves the origin of the coordinate system.