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
pageis converted to a whole number.- The page is clamped:
- It is never higher than the page count from PageWindowGetNumPages (or 1 if that is lower).
- It is never lower than 2 minus PageWindowGetNumPagesDisplayed. For a single-page window that is 1; for a two-page window, page 0 is accepted.
- 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 existError 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 )
