Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

103 lines (70 sloc) 3.547 kb
/**
\page lua_api_video Video
\c sol.video allows you to change the video mode.
The screen size is fixed at compilation time: it's usually 320*240
unless you set otherwise with the appropriate compilation flags.
What we call "screen" or "logcial screen" on this page is the logical
surface where the game or the menus take place.
Its size never changes at runtime.
At runtime, the video mode can be changed. The video mode determines
the size of the window and how the logical screen is displayed on this
window when the window is larger.
The video mode is automatically saved (as well as the language and the volume),
independently of savegames.
Video modes are identified by strings in the Lua API.
The following modes are implemented:
- \c "windowed_stretched" (default): The logical screen is stretched onto a
window of double size.
- \c "windowed_scale2x": The logical screen is scaled onto a window of
double size with the Scale2X algorithm.
- \c "windowed_normal": The logical screen is displayed onto a window of the
same size.
- \c "fullscreen_normal": The logical screen is displayed in fullscreen with
a resolution of the same size.
- \c "fullscreen_wide": The logical screen is stretched on a surface of
double size and then displayed in fullscreen onto a widescreen resolution
with two black side bars.
This video mode is adapted to wide devices.
- \c "fullscreen_scale2x": The logical screen is scaled onto a surface of
double size with the Scale2X algorithm, and then displayed in fullscreen
with a resolution of this double size.
- \c "fullscreen_scale2x_wide": The logical screen is scaled on a surface of
double size with the Scale2X algorithm, and then displayed in fullscreen
onto a widescreen resolution with two black side bars.
This video mode is adapted to wide devices.
\remark On some platforms, some video modes may be unavailable or disabled
at compilation time. Use \ref lua_api_video_is_mode_supported to test a
video mode, and \ref lua_api_video_get_modes to know the list of
video modes supported.
<hr>
\section lua_api_video_functions Functions of sol.video
<hr>
\subsection lua_api_video_get_mode sol.video.get_mode()
Returns the current video mode.
- Return value (string): Name of the video mode (see the list above).
<hr>
\subsection lua_api_video_set_mode sol.video.set_mode(video_mode)
Sets the current video mode.
- \c video_mode (string): Name of the video mode (see the list above).
<hr>
\subsection lua_api_video_switch_mode sol.video.switch_mode()
Sets the next video mode in the list of video modes supported.
You can use this function if you want to change the video mode without
specifying which one to use.
<hr>
\subsection lua_api_video_is_mode_supported sol.video.is_mode_supported()
Returns whether a video mode is supported.
- \c video_mode (string): Name of a video mode (see the list above).
<hr>
\subsection lua_api_video_get_modes sol.video.get_modes()
Returns an array of all video modes supported.
- \c video_mode (string): Name of a video mode (see the list above).
<hr>
\subsection lua_api_video_is_fullscreen sol.video.is_fullscreen()
Returns whether the current video mode is fullscreen.
- Return value (boolean): \c true if the video mode is fullscreen.
<hr>
\subsection lua_api_video_set_fullscreen sol.video.set_fullscreen([fullscreen])
Turns on or turns off fullscreen, keeping an equivalent video mode.
- \c fullscreen (boolean, optional): \c true to set fullscreen (default).
*/
Jump to Line
Something went wrong with that request. Please try again.