API:DynamicImageSetRotation
From RoR Wiki
UI Lua API · DynamicImage functions
Version: WAR 1.4.8
Rotates the picture shown by a DynamicImage.
DynamicImageSetRotation(imageName, angle)
Arguments
- imageName
string– Name of a DynamicImage window.- angle
number– Rotation angle in degrees.
Returns
Nothing.
Details
- The client converts the angle to radians. If it equals the current angle, nothing happens.
- The function needs at least two arguments and only reads the last two.
Errors
Error in function call 'DynamicImageSetRotation': Window %s does not existError in function call 'DynamicImageSetRotation': Window %s is not a DynamicImage
Example
Turning a gauge needle, from ea_careerresourceswindow/source/choppa.lua:
local rotationModifier = 180 / g_resource_max
local rotate = ( currentResourceValue * rotationModifier ) - 90
if ( rotate < 0 )
then
rotate = 360 + rotate
end
DynamicImageSetRotation( g_resource_window.."Needle", rotate )
