API:PageWindowGetNumPagesDisplayed
From RoR Wiki
UI Lua API · PageWindow functions
Version: WAR 1.4.8
Returns how many pages a PageWindow shows side by side.
numDisplayed = PageWindowGetNumPagesDisplayed(pageWindowName)
Arguments
- pageWindowName
string– Name of the PageWindow.
Returns
- numDisplayed
number– Number of pages visible at the same time, for example 2 for an open book.
Details
- The window's width is divided between this many pages when the pages are laid out.
- There is no Lua function to change this value.
Errors
Error in function call 'PageWindowGetNumPagesDisplayed': Window %s does not existError in function call 'PageWindowGetNumPagesDisplayed': Window %s is not a PageWindow
Example
Turning back by one spread, from TomeWindow.FlipPageWindowBackward in default/ea_tomeofknowledge/source/tomewindow.lua:
local curPage = PageWindowGetCurrentPage( pageWindow )
if( curPage == 1 ) then
return false
end
local flipPages = PageWindowGetNumPagesDisplayed( pageWindow )
PageWindowSetCurrentPage( pageWindow, curPage - flipPages )
