Ejemplo n.º 1
0
func (p *PathShape) SetPosition(position sf.Vector2f) {
	transform := sf.TransformIdentity()
	transform.Translate(position.X, position.Y)
	for i := 0; i < len(p.ctrls); i++ {
		p.ctrls[i].point = transform.TransformPoint(p.ctrls[i].point)
	}
	p.AllToCurve()
}
Ejemplo n.º 2
0
func (p *PathShape) SetRotation(angle float32) {
	transform := sf.TransformIdentity()
	transform.RotateWithCenter(angle, p.ctrls[0].point.X, p.ctrls[0].point.Y)
	for i := 0; i < len(p.ctrls); i++ {
		p.ctrls[i].point = transform.TransformPoint(p.ctrls[i].point)
	}
	p.AllToCurve()
}