Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:CircleImageSetTexture

From RoR Wiki

UI Lua API · CircleImage functions
Version: WAR 1.4.8

Sets the texture a CircleImage shows and which point of it is at the circle's centre.

CircleImageSetTexture(imageName, textureName, x, y)

Arguments

imageName
string – Name of a CircleImage window.
textureName
string – Name of the texture.
x, y
number – Pixel position in the texture that is drawn at the centre of the circle. Fractions are dropped.

Returns

Nothing.

Details

  • The texture is loaded by name and the circle is rebuilt with it.
  • How much of the texture around that point is visible depends on the window's size and the texture scale (see CircleImageSetTextureScale).
  • To show an icon from an icon texture, the stock UI adds half the window size to the icon's top-left corner (see the example).

Errors

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

Example

A round morale-ability icon, from ea_abilitieswindow/source/abilitieswindow.lua:

local texture, x, y = GetIconData( ability.iconNum )
...
local winX, winY = WindowGetDimensions( window.."CircleIcon" )
CircleImageSetTexture (window.."CircleIcon", texture, x + winX/2, y + winY/2)

A group member's portrait, from eatemplate_unitframes/source/groupmemberunitframe.lua:

CircleImageSetTexture( newUnitFrame:GetName().."Portrait", "render_scene_group_portrait"..UnitIdToGroupMemberMapping[unitId].groupMemberIndex, 40, 54 )

See also