Safe Haskell | None |
---|---|
Language | Haskell98 |
SFML.Graphics.SFTransformable
Documentation
class SFTransformable a where
Methods
setPosition :: a -> Vec2f -> IO ()
Set the position of a transformable.
This function completely overwrites the previous position.
See move
to apply an offset based on the previous position instead.
The default position of a transformable object is (0, 0).
Set the orientation of a transformable.
This function completely overwrites the previous rotation.
See rotate
to add an angle based on the previous rotation instead.
The default rotation of a transformable SFTransformable object is 0.
setScale :: a -> Vec2f -> IO ()
Set the scale factors of a transformable.
This function completely overwrites the previous scale.
See scale
to add a factor based on the previous scale instead.
The default scale of a transformable SFTransformable object is (1, 1).
setOrigin :: a -> Vec2f -> IO ()
Set the local origin of a transformable.
The origin of an object defines the center point for all transformations (position, scale, rotation).
The coordinates of this point must be relative to the top-left corner of the object, and ignore all transformations (position, scale, rotation).
The default origin of a transformable SFTransformable object is (0, 0).
getPosition :: a -> IO Vec2f
Get the position of a transformable.
Get the orientation of a transformable.
Get the current scale of a transformable
Get the local origin of a transformable.
Move a transformable by a given offset
This function adds to the current position of the object,
unlike setPosition
which overwrites it.
Rotate a transformable.
This function adds to the current rotation of the object,
unlike setRotation
which overwrites it.
Scale a transformable.
This function multiplies the current scale of the object,
unlike setScale
which overwrites it.
getTransform :: a -> IO Transform
Get the combined transform of a transformable.
getInverseTransform :: a -> IO Transform
Get the inverse of the combined transform of a transformable.