From 6ef42cf1eae12a05c51e16106c5af5a0644ebf94 Mon Sep 17 00:00:00 2001 From: faiface Date: Mon, 19 Dec 2016 01:29:08 +0100 Subject: [PATCH] add getters to Transform --- transform.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/transform.go b/transform.go index f567aa0..2d73b56 100644 --- a/transform.go +++ b/transform.go @@ -27,6 +27,26 @@ func Position(position Vec) Transform { } } +// GetPosition returns the position of a transform. +func (t Transform) GetPosition() Vec { + return t.pos +} + +// GetAnchor returns the anchor of a transform. +func (t Transform) GetAnchor() Vec { + return t.anc +} + +// GetScale returns the scale (2 dimensional) of transform. +func (t Transform) GetScale() Vec { + return t.sca +} + +// GetRotation returns the rotation of a transform (in radians). +func (t Transform) GetRotation() float64 { + return t.rot +} + // Position sets position. func (t Transform) Position(position Vec) Transform { t.pos = position