Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:CircleImageSetFillParams

From RoR Wiki

UI Lua API · CircleImage functions
Version: WAR 1.4.8

Sets which part of a CircleImage is drawn, as a pie-shaped arc.

CircleImageSetFillParams(imageName, startAngle, fillAngle)

Arguments

imageName
string – Name of a CircleImage window.
startAngle
number – Angle in degrees where the drawn arc begins.
fillAngle
number – Size of the arc in degrees. 360 draws the full circle. This is the extent of the arc, not the angle where it ends.

Returns

Nothing.

Details

  • Both angles are converted to radians and stored. If the image's geometry already exists, it is rebuilt at once with the new arc.
  • The stock UI uses it to draw a countdown ring that empties over time (see the example).

Errors

  • Error in function call 'CircleImageSetFillParams': Window %s does not exist
  • Error in function call 'CircleImageSetFillParams': Window %s is not a CircleImage

Example

From ea_playerstatuswindow/source/playerwindow.lua:

-- Starts at 12 o'clock and decreases clockwise
local startFill = 360 * (1 - (PlayerWindow.KillingSpreeRemainingTime / PlayerWindow.KillingSpreeTotalTime))
CircleImageSetFillParams( "PlayerWindowKillingSpreeArc", -96 + startFill,  360 - startFill )

See also