Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:PageWindowSetCurrentPage

From RoR Wiki

UI Lua API · PageWindow functions
Version: WAR 1.4.8

Turns a PageWindow to the given page.

PageWindowSetCurrentPage(pageWindowName, page)

Arguments

pageWindowName
string – Name of the PageWindow.
page
number – Page to show, counted from 1. For a PageWindow that shows several pages side by side, this becomes the first (leftmost) page shown.

Returns

Nothing.

Details

  • page is converted to a whole number.
  • The page is clamped:
  • The PageWindow's content is moved so that the page is the first one shown.
  • No event or script handler is triggered.
  • 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 'PageWindowSetCurrentPage': Window %s does not exist
  • Error in function call 'PageWindowSetCurrentPage': Window %s is not a PageWindow

Example

From TomeWindow.FlipPageWindowForward in default/ea_tomeofknowledge/source/tomewindow.lua:

PageWindowSetCurrentPage( pageWindow, curPage + flipPages )
TomeWindow.PlayFlipAnim( TomeWindow.FLIP_FORWARD_SINGLE )

See also