Files
CodenameEngine/pages/scripting/GlobalScript.html
T
2023-01-22 14:36:01 +01:00

14 lines
8.1 KiB
HTML
Vendored

<!DOCTYPE html>
<html lang="en"><!-- use theme color or fallback -->
<!--use textcolor from settings, otherwise create a contrasting color to theme color-->
<head><meta charset="utf-8"/><link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet"/><link href="../bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet"/><link href="../bootstrap/css/bootstrap-select.min.css" rel="stylesheet"/><link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700,700italic,400italic" rel="stylesheet" type="text/css"/><link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,600,600italic,400" rel="stylesheet" type="text/css"/><link href="https://netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.css" rel="stylesheet" type="text/css"/><script src="../jquery-1.9.1.min.js"></script><script src="../bootstrap/js/bootstrap.min.js"></script><script src="../bootstrap/js/bootstrap-select.min.js"></script><link href="../styles.css" rel="stylesheet"/><link href="../extra-styles.css" rel="stylesheet"/><link href="../haxe-nav.css" rel="stylesheet"/><link href="../dark-mode.css" rel="stylesheet"/><script>var dox = {rootPath: "../",platforms: ["doc"]};</script><script src="../nav.js"></script><script src="../index.js"></script><link rel="icon" href="../favicon.ico" type="image/x-icon"/><title>scripting.GlobalScript</title><meta name="description" content="A global script is a special kind of script that runs on everywhere on your mod: menus, game, etc..."/></head><body><script>/* Here to prevent flash of unstyled content */let systemDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;if ((!localStorage.theme && systemDarkMode) || localStorage.theme == "dark") {document.body.style.backgroundColor = "#111";document.body.style.opacity = "0";document.addEventListener("DOMContentLoaded", function(event) {toggleTheme();document.body.style.backgroundColor = "";document.body.style.opacity = "";});}</script><style>
.navbar .brand {
display: inline-block;
float: none;
text-shadow: 0 0 0 transparent;
}
</style><nav class="nav"><div class="navbar"><div class="navbar-inner" style="background:#FAFAFA; border-bottom:1px solid rgba(0,0,0,.09)"><div class="container"><a class="brand" style="color:#000000" href="../">API Documentation</a><a href="#" id="theme-toggle" class="brand" style="color:#000000" onclick="toggleTheme()" title="Toggle Dark Mode"><i class="fa fa-moon-o"></i></a></div></div></div></nav><div class="container main-content"><div class="row-fluid"><div class="span3"><div class="well sidebar-nav"><form class="form-search" id="searchForm"><div class="input-prepend input-block-level"><span class="add-on"><i class="fa fa-search"></i></span><input id="search" type="text" placeholder="Filter (Ctrl+P)" autocomplete="off"/></div></form></div><div class="well sidebar-nav" id="explorer"><div id="nav"></div></div></div><div class="span9"><div class="page-header"><h1><small>interface</small> GlobalScript</h1><h4><small>package <a href="../scripting/index.html">scripting</a></small></h4> </div><div class="body"><div class="doc doc-main"><p>A global script is a special kind of script that runs on everywhere on your mod: menus, game, etc...</p>
<p>To create one, go to data and create a script named "global", then press F5 in game to hot reload.</p>
<p>All flixel signals are automatically binded, as shown below.</p></div><h3 class="section">Methods</h3><div class="fields"><div class="field "><a name="focusGained"></a><h3 class="anchor"><code><a href="#focusGained"><span class="identifier">focusGained</span></a>():<span class="type">Void</span></code></h3><div class="doc"><p>Called whenever the game gains focus.</p></div></div><div class="field "><a name="focusLost"></a><h3 class="anchor"><code><a href="#focusLost"><span class="identifier">focusLost</span></a>():<span class="type">Void</span></code></h3><div class="doc"><p>Called whenever the game loses focus.</p></div></div><div class="field "><a name="gameResized"></a><h3 class="anchor"><code><a href="#gameResized"><span class="identifier">gameResized</span></a>(<span style="white-space:nowrap">width:<span class="type">Int</span>,</span> <span style="white-space:nowrap">height:<span class="type">Int</span></span>):<span class="type">Void</span></code></h3><div class="doc"><p>Called whenever the game loses focus.</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th style="width:25%;"><code>width</code></th><td><p>Width of the game</p></td></tr><tr><th style="width:25%;"><code>height</code></th><td><p>Height of the game</p></td></tr></table></div></div><div class="field "><a name="postDraw"></a><h3 class="anchor"><code><a href="#postDraw"><span class="identifier">postDraw</span></a>():<span class="type">Void</span></code></h3><div class="doc"><p>Called after the screen has been drawn.</p></div></div><div class="field "><a name="postGameReset"></a><h3 class="anchor"><code><a href="#postGameReset"><span class="identifier">postGameReset</span></a>():<span class="type">Void</span></code></h3><div class="doc"><p>Called after the game has been reset.</p></div></div><div class="field "><a name="postGameStart"></a><h3 class="anchor"><code><a href="#postGameStart"><span class="identifier">postGameStart</span></a>():<span class="type">Void</span></code></h3><div class="doc"><p>Called after the game has been started.</p></div></div><div class="field "><a name="postStateSwitch"></a><h3 class="anchor"><code><a href="#postStateSwitch"><span class="identifier">postStateSwitch</span></a>():<span class="type">Void</span></code></h3><div class="doc"><p>Called after the state has been switched.</p></div></div><div class="field "><a name="postUpdate"></a><h3 class="anchor"><code><a href="#postUpdate"><span class="identifier">postUpdate</span></a>(<span style="white-space:nowrap">elapsed:<span class="type">Float</span></span>):<span class="type">Void</span></code></h3><div class="doc"><p>Called after the game has been updated.</p>
<p>Aliases: <code>postUpdate</code></p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th style="width:25%;"><code>elapsed</code></th><td><p>Time elapsed since last frame</p></td></tr></table></div></div><div class="field "><a name="preDraw"></a><h3 class="anchor"><code><a href="#preDraw"><span class="identifier">preDraw</span></a>():<span class="type">Void</span></code></h3><div class="doc"><p>Called before the game draws on screen.</p></div></div><div class="field "><a name="preGameReset"></a><h3 class="anchor"><code><a href="#preGameReset"><span class="identifier">preGameReset</span></a>():<span class="type">Void</span></code></h3><div class="doc"><p>Called before the game resets.</p></div></div><div class="field "><a name="preGameStart"></a><h3 class="anchor"><code><a href="#preGameStart"><span class="identifier">preGameStart</span></a>():<span class="type">Void</span></code></h3><div class="doc"><p>Called before the game starts.</p></div></div><div class="field "><a name="preStateCreate"></a><h3 class="anchor"><code><a href="#preStateCreate"><span class="identifier">preStateCreate</span></a>(<span style="white-space:nowrap">state:<span class="type">FlxState</span></span>):<span class="type">Void</span></code></h3><div class="doc"><p>Called before the state creates.</p></div></div><div class="field "><a name="preStateSwitch"></a><h3 class="anchor"><code><a href="#preStateSwitch"><span class="identifier">preStateSwitch</span></a>():<span class="type">Void</span></code></h3><div class="doc"><p>Called before the state switches.</p></div></div><div class="field "><a name="update"></a><h3 class="anchor"><code><a href="#update"><span class="identifier">update</span></a>(<span style="white-space:nowrap">elapsed:<span class="type">Float</span></span>):<span class="type">Void</span></code></h3><div class="doc"><p>Called before the game updates.</p>
<p>Aliases: <code>preUpdate</code></p></div></div></div></div></div></div></div><footer class="section site-footer" style="background:#FAFAFA"><div class="container"><div class="copyright"><p style="color:#000000">&copy; 2023 &nbsp;</p></div></div></footer><script src="..//highlighter.js"></script><link href="../highlighter.css" rel="stylesheet"/></body></html>