UNPKG

crossbrowdy

Version:

A Multimedia JavaScript framework to create real cross-platform and hybrid game engines, games, emulators, multimedia libraries and apps.

2,978 lines (906 loc) 144 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>CrossBrowdy API documentation [printable] Namespace: CB_Screen</title> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/sunlight.default.css"> <link type="text/css" rel="stylesheet" href="styles/site.yeti.css"> </head> <body style="min-width:800px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"> <div class="navbar navbar-default navbar-fixed-top "> <div class="container"> <div class="navbar-header"> <a class="navbar-brand" href="index.html">CrossBrowdy API documentation [printable]</a> <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <div class="navbar-collapse collapse" id="topNavigation"> <ul class="nav navbar-nav"> <li class="dropdown"> <a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b class="caret"></b></a> <ul class="dropdown-menu inline"> <li><a href="CB_Arrays.html">CB_Arrays</a></li><li><a href="CB_AudioDetector.html">CB_AudioDetector</a></li><li><a href="CB_Client.html">CB_Client</a></li><li><a href="CB_Collisions.html">CB_Collisions</a></li><li><a href="CB_Configuration.html">CB_Configuration</a></li><li><a href="CB_Configuration.CrossBase.html">CB_Configuration.CrossBase</a></li><li><a href="CB_Configuration.CrossBrowdy.html">CB_Configuration.CrossBrowdy</a></li><li><a href="CB_Controllers.html">CB_Controllers</a></li><li><a href="CB_Controllers_Proprietary.html">CB_Controllers_Proprietary</a></li><li><a href="CB_Controllers_Proprietary.WII.html">CB_Controllers_Proprietary.WII</a></li><li><a href="CB_Controllers_Proprietary.WII_U.html">CB_Controllers_Proprietary.WII_U</a></li><li><a href="CB_Device.html">CB_Device</a></li><li><a href="CB_Device.AmbientLight.html">CB_Device.AmbientLight</a></li><li><a href="CB_Device.Battery.html">CB_Device.Battery</a></li><li><a href="CB_Device.Location.html">CB_Device.Location</a></li><li><a href="CB_Device.Motion.html">CB_Device.Motion</a></li><li><a href="CB_Device.Orientation.html">CB_Device.Orientation</a></li><li><a href="CB_Device.Proximity.html">CB_Device.Proximity</a></li><li><a href="CB_Device.Vibration.html">CB_Device.Vibration</a></li><li><a href="CB_Elements.html">CB_Elements</a></li><li><a href="CB_Events.html">CB_Events</a></li><li><a href="CB_Keyboard.html">CB_Keyboard</a></li><li><a href="CB_Keyboard.chars.html">CB_Keyboard.chars</a></li><li><a href="CB_Keyboard.extended.html">CB_Keyboard.extended</a></li><li><a href="CB_Keyboard.keys.html">CB_Keyboard.keys</a></li><li><a href="CB_Modules.html">CB_Modules</a></li><li><a href="CB_Mouse.html">CB_Mouse</a></li><li><a href="CB_Mouse.CursorImage.html">CB_Mouse.CursorImage</a></li><li><a href="CB_Net.html">CB_Net</a></li><li><a href="CB_Net.Fetch.html">CB_Net.Fetch</a></li><li><a href="CB_Net.REST.html">CB_Net.REST</a></li><li><a href="CB_Net.Sockets.html">CB_Net.Sockets</a></li><li><a href="CB_Net.Sockets.SockJS.html">CB_Net.Sockets.SockJS</a></li><li><a href="CB_Net.XHR.html">CB_Net.XHR</a></li><li><a href="CB_Pointer.html">CB_Pointer</a></li><li><a href="CB_Screen.html">CB_Screen</a></li><li><a href="CB_Speaker.html">CB_Speaker</a></li><li><a href="CB_Touch.html">CB_Touch</a></li><li><a href="CB_baseSymbols.html">CB_baseSymbols</a></li> </ul> </li> <li class="dropdown"> <a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a> <ul class="dropdown-menu inline"> <li><a href="CB_AudioFile.html">CB_AudioFile</a></li><li><a href="CB_AudioFileCache.html">CB_AudioFileCache</a></li><li><a href="CB_AudioFileSprites.html">CB_AudioFileSprites</a></li><li><a href="CB_AudioFileSpritesPool.html">CB_AudioFileSpritesPool</a></li><li><a href="CB_AudioFile_API.AAPI.html">CB_AudioFile_API.AAPI</a></li><li><a href="CB_AudioFile_API.ACMP.html">CB_AudioFile_API.ACMP</a></li><li><a href="CB_AudioFile_API.SM2.html">CB_AudioFile_API.SM2</a></li><li><a href="CB_AudioFile_API.WAAPI.html">CB_AudioFile_API.WAAPI</a></li><li><a href="CB_Canvas.html">CB_Canvas</a></li><li><a href="CB_GraphicSprites.html">CB_GraphicSprites</a></li><li><a href="CB_GraphicSpritesScene.html">CB_GraphicSpritesScene</a></li> </ul> </li> <li class="dropdown"> <a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a> <ul class="dropdown-menu inline"> <li><a href="global.html#CB_BASE_NAME">CB_BASE_NAME</a></li><li><a href="global.html#CB_CREDITS_DEFAULT">CB_CREDITS_DEFAULT</a></li><li><a href="global.html#CB_NAME">CB_NAME</a></li><li><a href="global.html#CB_OPTIONS">CB_OPTIONS</a></li><li><a href="global.html#CB_VERSION">CB_VERSION</a></li><li><a href="global.html#CB_addCredits">CB_addCredits</a></li><li><a href="global.html#CB_baseToBase">CB_baseToBase</a></li><li><a href="global.html#CB_baseToInt">CB_baseToInt</a></li><li><a href="global.html#CB_br2nl">CB_br2nl</a></li><li><a href="global.html#CB_brToNl">CB_brToNl</a></li><li><a href="global.html#CB_combineArraysOrObjects">CB_combineArraysOrObjects</a></li><li><a href="global.html#CB_combineAutomatically">CB_combineAutomatically</a></li><li><a href="global.html#CB_combineJSON">CB_combineJSON</a></li><li><a href="global.html#CB_combineURIParameters">CB_combineURIParameters</a></li><li><a href="global.html#CB_combineURLParameters">CB_combineURLParameters</a></li><li><a href="global.html#CB_console">CB_console</a></li><li><a href="global.html#CB_copyObject">CB_copyObject</a></li><li><a href="global.html#CB_countDecimalDigits">CB_countDecimalDigits</a></li><li><a href="global.html#CB_countDecimalPart">CB_countDecimalPart</a></li><li><a href="global.html#CB_countDecimals">CB_countDecimals</a></li><li><a href="global.html#CB_countIntegerDigits">CB_countIntegerDigits</a></li><li><a href="global.html#CB_countIntegerPart">CB_countIntegerPart</a></li><li><a href="global.html#CB_credits">CB_credits</a></li><li><a href="global.html#CB_forEach">CB_forEach</a></li><li><a href="global.html#CB_forceString">CB_forceString</a></li><li><a href="global.html#CB_getBase64StringObject">CB_getBase64StringObject</a></li><li><a href="global.html#CB_getCookie">CB_getCookie</a></li><li><a href="global.html#CB_getDatum">CB_getDatum</a></li><li><a href="global.html#CB_getJSONPropertyValue">CB_getJSONPropertyValue</a></li><li><a href="global.html#CB_getLZStringObject">CB_getLZStringObject</a></li><li><a href="global.html#CB_getValueIndex">CB_getValueIndex</a></li><li><a href="global.html#CB_getValuePath">CB_getValuePath</a></li><li><a href="global.html#CB_includeJSFile">CB_includeJSFile</a></li><li><a href="global.html#CB_indexOf">CB_indexOf</a></li><li><a href="global.html#CB_init">CB_init</a></li><li><a href="global.html#CB_intToBase">CB_intToBase</a></li><li><a href="global.html#CB_isArray">CB_isArray</a></li><li><a href="global.html#CB_isEmail">CB_isEmail</a></li><li><a href="global.html#CB_isFileLocal">CB_isFileLocal</a></li><li><a href="global.html#CB_isString">CB_isString</a></li><li><a href="global.html#CB_lastIndexOf">CB_lastIndexOf</a></li><li><a href="global.html#CB_ltrim">CB_ltrim</a></li><li><a href="global.html#CB_nl2br">CB_nl2br</a></li><li><a href="global.html#CB_nlToBr">CB_nlToBr</a></li><li><a href="global.html#CB_numberFormat">CB_numberFormat</a></li><li><a href="global.html#CB_numberOfDecimalDigits">CB_numberOfDecimalDigits</a></li><li><a href="global.html#CB_numberOfDecimals">CB_numberOfDecimals</a></li><li><a href="global.html#CB_numberOfIntegerDigits">CB_numberOfIntegerDigits</a></li><li><a href="global.html#CB_parseJSON">CB_parseJSON</a></li><li><a href="global.html#CB_parseString">CB_parseString</a></li><li><a href="global.html#CB_regularExpressionString">CB_regularExpressionString</a></li><li><a href="global.html#CB_renderString">CB_renderString</a></li><li><a href="global.html#CB_replaceAll">CB_replaceAll</a></li><li><a href="global.html#CB_rtrim">CB_rtrim</a></li><li><a href="global.html#CB_scriptPath">CB_scriptPath</a></li><li><a href="global.html#CB_scriptPathCalculate">CB_scriptPathCalculate</a></li><li><a href="global.html#CB_setCookie">CB_setCookie</a></li><li><a href="global.html#CB_setDatum">CB_setDatum</a></li><li><a href="global.html#CB_sizeOf">CB_sizeOf</a></li><li><a href="global.html#CB_sizeof">CB_sizeof</a></li><li><a href="global.html#CB_stringifyJSON">CB_stringifyJSON</a></li><li><a href="global.html#CB_symmetricCall">CB_symmetricCall</a></li><li><a href="global.html#CB_symmetricCallClear">CB_symmetricCallClear</a></li><li><a href="global.html#CB_this">CB_this</a></li><li><a href="global.html#CB_trim">CB_trim</a></li> </ul> </li> </ul> <div class="col-sm-3 col-md-3"> <form class="navbar-form" role="search"> <div class="input-group"> <input type="text" class="form-control" placeholder="Search" name="q" id="search-input"> <div class="input-group-btn"> <button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button> </div> </div> </form> </div> </div> </div> </div> <div class="container" id="toc-content" style="width:100%;"> <div class="row" style="width:100%;"> <div class="col-md-8" style="width:85%;"> <div id="main"> <h1 class="page-title">Namespace: CB_Screen</h1> <section> <header> <h2> CB_Screen </h2> </header> <article> <div class="container-overview"> <div class="description"><p>Static class to manage the screen. It will return itself if it is tried to be instantiated. It can use <a href="https://github.com/tombigel/detect-zoom">detect-zoom</a> and <a href="https://github.com/richtr/NoSleep.js?utm_source=recordnotfound.com">NoSleep.js</a>.</p></div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-12">line 12</a> </li> </ul> </dd> </dl> </div> <h3 class="subsection-title">Methods</h3> <dl> <hr> <dt> <h4 class="name" id=".focus"><span class="type-signature">&lt;static> </span>focus<span class="signature">()</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Sets the focus to the main window (if possible).</p> </div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-647">line 647</a> </li> </ul> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".getAvailableHeight"><span class="type-signature">&lt;static> </span>getAvailableHeight<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4> </dt> <dd> <div class="description"> <p>Gets the current available screen height (vertical resolution). Uses the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Screen/availHeight">window.screen.availHeight</a> property internally, when possible.</p> </div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-244">line 244</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Returns the current available screen height (vertical resolution) in pixels.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".getAvailableHeightPrevious"><span class="type-signature">&lt;static> </span>getAvailableHeightPrevious<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4> </dt> <dd> <div class="description"> <p>Gets the previous available screen height (vertical resolution). Useful when the resolution (screen size and/or orientation) changed. Uses the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Screen/availHeight">window.screen.availHeight</a> property internally, when possible.</p> </div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-272">line 272</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Returns the previous available screen height (vertical resolution) in pixels.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".getAvailableWidth"><span class="type-signature">&lt;static> </span>getAvailableWidth<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4> </dt> <dd> <div class="description"> <p>Gets the current available screen width (horizontal resolution). Uses the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Screen/availWidth">window.screen.availWidth</a> property internally, when possible.</p> </div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-228">line 228</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Returns the current available screen width (horizontal resolution) in pixels.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".getAvailableWidthPrevious"><span class="type-signature">&lt;static> </span>getAvailableWidthPrevious<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4> </dt> <dd> <div class="description"> <p>Gets the previous available screen width (horizontal resolution). Useful when the resolution (screen size and/or orientation) changed. Uses the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Screen/availWidth">window.screen.availWidth</a> property internally, when possible.</p> </div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-260">line 260</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Returns the previous available screen width (horizontal resolution) in pixels.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".getColorDepth"><span class="type-signature">&lt;static> </span>getColorDepth<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4> </dt> <dd> <div class="description"> <p>Gets the current color depth. Uses the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Screen/colorDepth">window.screen.colorDepth</a> property internally, when possible.</p> </div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-354">line 354</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Returns the current color depth.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".getHeight"><span class="type-signature">&lt;static> </span>getHeight<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4> </dt> <dd> <div class="description"> <p>Gets the current screen height (vertical resolution). Uses the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Screen/height">window.screen.height</a> property internally, when possible.</p> </div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-188">line 188</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Returns the current screen height (vertical resolution) in pixels.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".getHeightPrevious"><span class="type-signature">&lt;static> </span>getHeightPrevious<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4> </dt> <dd> <div class="description"> <p>Gets the previous screen height (vertical resolution). Calculated through the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Screen/height">window.screen.height</a> property internally, when possible. Useful when the resolution (screen size and/or orientation) changed.</p> </div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-216">line 216</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Returns the previous screen height (vertical resolution) in pixels.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".getOrientation"><span class="type-signature">&lt;static> </span>getOrientation<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4> </dt> <dd> <div class="description"> <p>Gets the current orientation from the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Screen/orientation">screen orientation object</a> of the <a href="https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation">Screen Orientation API</a>.</p> </div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-1724">line 1724</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Returns a string with the current orientation from the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Screen/orientation">screen orientation object</a> of the <a href="https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation">Screen Orientation API</a>. If cannot be found, it will return &quot;landscape-primary&quot; as default.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".getOrientationObject"><span class="type-signature">&lt;static> </span>getOrientationObject<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h4> </dt> <dd> <div class="description"> <p>Gets the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Screen/orientation">screen orientation object</a> of the <a href="https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation">Screen Orientation API</a>.</p> </div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-1691">line 1691</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Returns the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Screen/orientation">screen orientation object</a> of the <a href="https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation">Screen Orientation API</a>.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Object</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".getPixelRatio"><span class="type-signature">&lt;static> </span>getPixelRatio<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4> </dt> <dd> <div class="description"> <p>Gets the current pixel ratio of the screen (main window). Uses <a href="https://github.com/tombigel/detect-zoom">detect-zoom</a> internally.</p> </div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-467">line 467</a> </li> </ul> </dd> <dt class="tag-todo method-doc-label method-doc-details-label">To Do:</dt> <dd class="tag-todo"> <ul> <li>Find a better and more-compatible way to detect pixel ratio which supports as many web clients as possible.</li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Returns the current pixel ratio of the screen (main window). Default pixel ratio is 1 (one) even when it fails.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".getPixelRatioPrevious"><span class="type-signature">&lt;static> </span>getPixelRatioPrevious<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4> </dt> <dd> <div class="description"> <p>Gets the previous pixel ratio of the screen (main window). Useful when the zoom/pixel-ratio changed. Uses <a href="https://github.com/tombigel/detect-zoom">detect-zoom</a> internally.</p> </div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-487">line 487</a> </li> </ul> </dd> <dt class="tag-todo method-doc-label method-doc-details-label">To Do:</dt> <dd class="tag-todo"> <ul> <li>Find a better and more-compatible way to detect pixel ratio which supports as many web clients as possible.</li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Returns the previous pixel ratio of the screen (main window). Default previous pixel ratio is 0 (zero) even when it fails.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".getScrollLeft"><span class="type-signature">&lt;static> </span>getScrollLeft<span class="signature">()</span><span class="type-signature"> &rarr; {number|null}</span></h4> </dt> <dd> <div class="description"> <p>Gets the current scroll left position (horizontal scroll) of the screen (main window). Uses the <a href="CB_Elements.html#.getScrollLeftById"><code>CB_Elements.getScrollLeftById</code></a> function internally.</p> </div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-369">line 369</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Returns the current scroll left position (horizontal scroll) of the screen (main window). It could return null if something fails.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> | <span class="param-type">null</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".getScrollTop"><span class="type-signature">&lt;static> </span>getScrollTop<span class="signature">()</span><span class="type-signature"> &rarr; {number|null}</span></h4> </dt> <dd> <div class="description"> <p>Gets the current scroll top position (vertical scroll) of the screen (main window). Uses the <a href="CB_Elements.html#.getScrollTopById"><code>CB_Elements.getScrollTopById</code></a> function internally.</p> </div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-402">line 402</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Returns the current scroll top position (vertical scroll) of the screen (main window). It could return null if something fails.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> | <span class="param-type">null</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".getWidth"><span class="type-signature">&lt;static> </span>getWidth<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4> </dt> <dd> <div class="description"> <p>Gets the current screen width (horizontal resolution). Uses the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Screen/width">window.screen.width</a> property internally, when possible.</p> </div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-172">line 172</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Returns the current screen width (horizontal resolution) in pixels.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".getWidthPrevious"><span class="type-signature">&lt;static> </span>getWidthPrevious<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4> </dt> <dd> <div class="description"> <p>Gets the previous screen width (horizontal resolution). Calculated through the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Screen/width">window.screen.width</a> property internally, when possible. Useful when the resolution (screen size and/or orientation) changed.</p> </div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-204">line 204</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Returns the previous screen width (horizontal resolution) in pixels.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".getWindowHeight"><span class="type-signature">&lt;static> </span>getWindowHeight<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4> </dt> <dd> <div class="description"> <p>Gets the current window height (vertical resolution). Internally, uses the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/innerHeight">window.innerHeight</a> if possible and fallbacks to <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/clientHeight">document.documentElement.clientHeight</a> or <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/clientHeight">document.body.clientHeight</a> property otherwise, when possible.</p> </div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-307">line 307</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Returns the current window height (vertical resolution) in pixels.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".getWindowHeightPrevious"><span class="type-signature">&lt;static> </span>getWindowHeightPrevious<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4> </dt> <dd> <div class="description"> <p>Gets the previous window height (vertical resolution). Useful when the resolution (screen size and/or orientation) or window size changed. Internally, uses the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/innerHeight">window.innerHeight</a> if possible and fallbacks to <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/clientHeight">document.documentElement.clientHeight</a> or <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/clientHeight">document.body.clientHeight</a> property otherwise, when possible.</p> </div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-342">line 342</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Returns the previous window height (vertical resolution) in pixels.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".getWindowWidth"><span class="type-signature">&lt;static> </span>getWindowWidth<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4> </dt> <dd> <div class="description"> <p>Gets the current window width (horizontal resolution). Internally, uses the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth">window.innerWidth</a> if possible and fallbacks to <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/clientWidth">document.documentElement.clientWidth</a> or <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/clientWidth">document.body.clientWidth</a> property otherwise, when possible.</p> </div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-284">line 284</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Returns the current window width (horizontal resolution) in pixels.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".getWindowWidthPrevious"><span class="type-signature">&lt;static> </span>getWindowWidthPrevious<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4> </dt> <dd> <div class="description"> <p>Gets the previous window width (horizontal resolution). Useful when the resolution (screen size and/or orientation) or window size changed. Internally, uses the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth">window.innerWidth</a> if possible and fallbacks to <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/clientWidth">document.documentElement.clientWidth</a> or <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/clientWidth">document.body.clientWidth</a> property otherwise, when possible.</p> </div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-330">line 330</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Returns the previous window width (horizontal resolution) in pixels.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".getZoom"><span class="type-signature">&lt;static> </span>getZoom<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4> </dt> <dd> <div class="description"> <p>Gets the current zoom level of the screen (main window). Uses <a href="https://github.com/tombigel/detect-zoom">detect-zoom</a> internally.</p> </div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-436">line 436</a> </li> </ul> </dd> <dt class="tag-todo method-doc-label method-doc-details-label">To Do:</dt> <dd class="tag-todo"> <ul> <li>Find a better and more-compatible way to detect zoom which supports as many web clients as possible.</li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Returns the current zoom level of the screen (main window). Default zoom level is 1 (one) even when it fails.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".getZoomPrevious"><span class="type-signature">&lt;static> </span>getZoomPrevious<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4> </dt> <dd> <div class="description"> <p>Gets the previous zoom level of the screen (main window). Useful when the zoom changed. Uses <a href="https://github.com/tombigel/detect-zoom">detect-zoom</a> internally.</p> </div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-455">line 455</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Returns the previous zoom level of the screen (main window). Default previous zoom level is 0 (zero) even when it fails.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".isFocused"><span class="type-signature">&lt;static> </span>isFocused<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4> </dt> <dd> <div class="description"> <p>Tells whether the main window is focused or not.</p> </div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-637">line 637</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Returns whether the main window is focused or not.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">boolean</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".isFullScreen"><span class="type-signature">&lt;static> </span>isFullScreen<span class="signature">( [allowedWidthMarginPercentage] [, allowedHeightMarginPercentage])</span><span class="type-signature"> &rarr; {boolean}</span></h4> </dt> <dd> <div class="description"> <p>Tells whether we are in full screen mode or not. Uses the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API">Fullscreen API</a> and fallbacks to other methods internally, including <a href="https://nwjs.io/">NW.js (formerly node-webkit)</a> and <a href="https://electronjs.org/">Electron (Electron.js)</a> ones, when not available.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th style="width:12%; min-width:110px;">Name</th> <th style="width:12%; min-width:110px;">Type</th> <th style="width:12%; min-width:110px;">Argument</th> <th style="width:12%; min-width:110px;">Default</th> <th class="last" style="min-width:310px;">Description</th> </tr> </thead> <tbody> <tr> <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>allowedWidthMarginPercentage</code></td> <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"> <span class="param-type">number</span> </td> <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"> &lt;optional><br> </td> <td class="default" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"> CB_Configuration.CrossBase.CB_Screen_isFullScreen_ALLOWED_WIDTH_MARGIN_PERCENTAGE </td> <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>Allowed width margin, in percentage, of the total screen available to detect whether it is in full screen or not. Needed by old web clients without <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API">Fullscreen API</a> support, mainly.</p></td> </tr> <tr> <td class="name" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><code>allowedHeightMarginPercentage</code></td> <td class="type" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"> <span class="param-type">number</span> </td> <td class="attributes" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"> &lt;optional><br> </td> <td class="default" style="width:12%; min-width:110px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"> CB_Configuration.CrossBase.CB_Screen_isFullScreen_ALLOWED_HEIGHT_MARGIN_PERCENTAGE </td> <td class="description last" style="min-width:310px; overflow-wrap:break-word; word-wrap:break-word; word-break:break-word; line-break:strict; hyphens:none; -webkit-hyphens:none; -moz-hyphens:none;"><p>Allowed height margin, in percentage, of the total screen available to detect whether it is in full screen or not. Needed by old web clients without <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API">Fullscreen API</a> support, mainly.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="CrossBase_audiovisual_image_CB_Screen.js.html">CrossBase/audiovisual/image/CB_Screen.js</a>, <a href="CrossBase_audiovisual_image_CB_Screen.js.html#sunlight-1-line-1245">line 1245</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Returns whether we are in full screen mode or not.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">boolean</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".isFullScreenAPICompatible"><span class="type-signature">&lt;static> </span>isFullScree