Here is an old chestnut that continues to confuse me. Let’s make this Enlightenment Monday!
From the documentation:
gui.set_rotation()
gui.set_rotation(node,rotation)
Sets the rotation of the supplied node. The rotation is expressed in degree Euler angles.
Using a euler z number throws an error:
local euler_z = math.atan2(unlocked_level_node_position.y-level_node_position.y, unlocked_level_node_position.x-level_node_position.x)
--gui.set_rotation(node, euler_z) -- ERROR:SCRIPT: /screens/map/map.gui_script:36: bad argument #2 to 'set_rotation' (quat expected, got number)
local rotation = vmath.quat_rotation_z(euler_z)
gui.set_rotation(node, rotation)
Converting the euler z to a quaternion works. Two questions:
Does “degree Euler angles” actually mean a quaternion?
Wouldn’t it make sense to use a number, either euler z or radians, in gui, since it’s in 2D space only?