Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:HorizontalScrollbarSetScrollPosition

From RoR Wiki

UI Lua API · Scrollbar functions
Version: WAR 1.4.8

Moves a HorizontalScrollbar to a scroll position.

HorizontalScrollbarSetScrollPosition(scrollbarName, position)

Arguments

scrollbarName
string – Name of the HorizontalScrollbar.
position
number – New scroll position.

Returns

Nothing.

Details

  • The position is clamped to the range from 0 to the maximum scroll position minus the page size (see HorizontalScrollbarGetMaxScrollPosition and HorizontalScrollbarGetPageSize).
  • If the clamped position differs from the current one, the thumb is moved and the scrollbar's OnScrollPosChanged handler runs with the new position.
  • If the position does not change, nothing happens and the handler does not run.
  • The stock UI never calls this function.
  • The function needs at least two arguments and only reads the last two. Any extra arguments placed in front of them are ignored.

Errors

  • Error in function call 'HorizontalScrollbarSetScrollPosition': Window %s does not exist
  • Error in function call 'HorizontalScrollbarSetScrollPosition': Window %s is not a HorizontalScrollbar

Example

A minimal example built from the signature:

HorizontalScrollbarSetScrollPosition( "MyScrollbar", 0 )

See also