Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:ButtonSetStayDownFlag

From RoR Wiki
Revision as of 19:40, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · Button functions
Version: WAR 1.4.8

Makes a Button stay pressed after it is clicked.

ButtonSetStayDownFlag(buttonName, stayDown)

Arguments

buttonName
string – Name of a Button window.
stayDown
boolean – true to make the button stay pressed, false for normal behaviour.

Returns

Nothing.

Details

  • When a stay-down button is released:
    • over the button, it stays pressed;
    • away from the button, it stays pressed only if it was already pressed before the click.
  • A normal button is released (its pressed flag cleared) when the mouse button goes up.
  • Use ButtonSetPressedFlag to release a stay-down button from Lua.
  • Changing the flag does not change the button's current pressed state or appearance.
  • stayDown must be a real boolean. Passing nil or a number raises an Invalid Parameters error.
  • The function needs at least two arguments and only reads the last two.

Errors

  • Error in function call 'ButtonSetStayDownFlag': Window %s does not exist
  • Error in function call 'ButtonSetStayDownFlag': Window %s is not a Button

Example

From eatemplate_defaultwindowskin/source/defaultbutton.lua:

function EA_Window_DefaultLabelToggleCircle.Initialize()
   local buttonName = SystemData.ActiveWindow.name.."Button"
   ButtonSetStayDownFlag( buttonName, true )
end

See also