-
Notifications
You must be signed in to change notification settings - Fork 0
/
Utils.html
12 lines (12 loc) · 12.9 KB
/
Utils.html
1
2
3
4
5
6
7
8
9
10
11
12
<!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: ["types"]};</script><script src="./nav.js"></script><script src="./index.js"></script><link rel="icon" href="./favicon.ico" type="image/x-icon"/><title>Utils</title></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>class</small> Utils</h1><h4><small><a href="./">no package</a></small></h4> <span class="label label-meta label-meta-directlyUsed" title="Marks types that are directly referenced by non-extern code.">@:directlyUsed</span></div><div class="body"><div class="doc doc-main"><p></p></div><h3 class="section">Static methods</h3><div class="fields"><div class="field "><a name="addLengthDir"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#addLengthDir"><span class="identifier">addLengthDir</span></a>(<span style="white-space:nowrap">point:<span class="type">FlxPoint</span>,</span> <span style="white-space:nowrap">length:<span class="type">Float</span>,</span> <span style="white-space:nowrap">degrees:<span class="type">Float</span></span>):<span class="type">Void</span></code></h3><div class="doc"><p>Moves the point by <code>length</code> pixels in the direction of a vector with an angle of <code>degrees</code>.</p></div></div><div class="field "><a name="angleDistance"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#angleDistance"><span class="identifier">angleDistance</span></a>(<span style="white-space:nowrap">from:<span class="type">Float</span>,</span> <span style="white-space:nowrap">to:<span class="type">Float</span></span>):<span class="type">Float</span></code></h3><div class="doc"><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th style="width:25%;"><code>from</code></th><td><p>Angle between <code>0</code> and <code>360</code>.</p></td></tr><tr><th style="width:25%;"><code>to</code></th><td><p>Angle between <code>0</code> and <code>360</code>.</p></td></tr></table><p class="javadoc">Returns:</p><div class="indent inline-content"><p>The shortest distance from one angle to another (between <code>-180</code> and <code>180</code>).</p></div></div></div><div class="field "><a name="angleTo"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#angleTo"><span class="identifier">angleTo</span></a>(<span style="white-space:nowrap">x1:<span class="type">Float</span>,</span> <span style="white-space:nowrap">y1:<span class="type">Float</span>,</span> <span style="white-space:nowrap">x2:<span class="type">Float</span>,</span> <span style="white-space:nowrap">y2:<span class="type">Float</span></span>):<span class="type">Float</span></code></h3><div class="doc"><p class="javadoc">Returns:</p><div class="indent inline-content"><p>The angle from point 1 to point 2, between <code>0</code> and <code>360</code>.</p></div></div></div><div class="field "><a name="degreesToRadians"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#degreesToRadians"><span class="identifier">degreesToRadians</span></a>(<span style="white-space:nowrap">degrees:<span class="type">Float</span></span>):<span class="type">Float</span></code></h3><div class="doc"><p></p></div></div><div class="field "><a name="distanceBetween"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#distanceBetween"><span class="identifier">distanceBetween</span></a>(<span style="white-space:nowrap">x1:<span class="type">Float</span>,</span> <span style="white-space:nowrap">y1:<span class="type">Float</span>,</span> <span style="white-space:nowrap">x2:<span class="type">Float</span>,</span> <span style="white-space:nowrap">y2:<span class="type">Float</span></span>):<span class="type">Float</span></code></h3><div class="doc"><p class="javadoc">Returns:</p><div class="indent inline-content"><p>The distance between two points.</p></div></div></div><div class="field "><a name="echoVector2AddLengthDir"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#echoVector2AddLengthDir"><span class="identifier">echoVector2AddLengthDir</span></a>(<span style="white-space:nowrap">echoVector:<span class="type">Vector2</span>,</span> <span style="white-space:nowrap">length:<span class="type">Float</span>,</span> <span style="white-space:nowrap">degrees:<span class="type">Float</span></span>):<span class="type">Void</span></code></h3><div class="doc"><p>Moves the Echo Vector2 by <code>length</code> pixels in the direction of a vector with an angle of <code>degrees</code>.</p></div></div><div class="field "><a name="echoVector2Set"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#echoVector2Set"><span class="identifier">echoVector2Set</span></a>(<span style="white-space:nowrap">echoVector:<span class="type">Vector2</span>,</span> <span style="white-space:nowrap">x:<span class="type">Float</span>,</span> <span style="white-space:nowrap">y:<span class="type">Float</span></span>):<span class="type">Void</span></code></h3><div class="doc"><p>Sets an Echo Vector2's <code>x</code> and <code>y</code> values. Handy if you need to do it in one line of code.</p></div></div><div class="field "><a name="echoVector2SetLengthDir"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#echoVector2SetLengthDir"><span class="identifier">echoVector2SetLengthDir</span></a>(<span style="white-space:nowrap">echoVector:<span class="type">Vector2</span>,</span> <span style="white-space:nowrap">length:<span class="type">Float</span>,</span> <span style="white-space:nowrap">degrees:<span class="type">Float</span></span>):<span class="type">Void</span></code></h3><div class="doc"><p>Sets an Echo Vector2's length and angle.</p></div></div><div class="field "><a name="echoVector2ToAngle"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#echoVector2ToAngle"><span class="identifier">echoVector2ToAngle</span></a>(<span style="white-space:nowrap">echoVector:<span class="type">Vector2</span></span>):<span class="type">Float</span></code></h3><div class="doc"><p class="javadoc">Returns:</p><div class="indent inline-content"><p>The angle of the Echo Vector2 in degrees.</p></div></div></div><div class="field "><a name="formatFloat"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#formatFloat"><span class="identifier">formatFloat</span></a>(<span style="white-space:nowrap">n:<span class="type">Float</span>,</span> <span style="white-space:nowrap">decimals:<span class="type">Int</span></span>):<span class="type">String</span></code></h3><div class="doc"><p>Formats a float to a string with a certain amount of decimal places.</p><p class="javadoc">Returns:</p><div class="indent inline-content"><p>The formatted string.</p></div></div></div><div class="field "><a name="getRandomFromArray"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#getRandomFromArray"><span class="identifier">getRandomFromArray</span></a>(<span style="white-space:nowrap">array:<span class="type">Array</span><<span class="type">Dynamic</span>></span>):<span class="type">Dynamic</span></code></h3><div class="doc"><p class="javadoc">Returns:</p><div class="indent inline-content"><p>Random object from the array.</p></div></div></div><div class="field "><a name="getString"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#getString"><span class="identifier">getString</span></a>(<span style="white-space:nowrap">flag:<span class="type">String</span>,</span> <span style="white-space:nowrap">?context:<span class="type">String</span></span>):<span class="type">String</span></code></h3><div class="doc"><p>Gets a localised string from a relevant context using <a href="https://github.com/larsiusprime/firetongue">FireTongue</a>.</p>
<p>Any instances of <code>GameValue</code>s in the string will be automatically replaced in the string (e.g. <code>{GameValue_Ability_Stun_Duration}</code> will be replaced with the actual stun duration).</p>
<p>If the string doesn't exist in the current locale, the function will attempt to find the string in the default <code>en-GB</code> locale.</p><p class="javadoc">Returns:</p><div class="indent inline-content"><p>The localised string.</p></div></div></div><div class="field "><a name="moveObjectLengthDir"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#moveObjectLengthDir"><span class="identifier">moveObjectLengthDir</span></a>(<span style="white-space:nowrap">gameObject:<a class="type" title="GameObject - The base GameObject used for almost everything in the game." href="./GameObject.html">GameObject</a>,</span> <span style="white-space:nowrap">length:<span class="type">Float</span>,</span> <span style="white-space:nowrap">degrees:<span class="type">Float</span></span>):<span class="type">Void</span></code></h3><div class="doc"><p>Moves a <code><a href="./GameObject.html">GameObject</a></code> by <code>length</code> pixels along a vector with an angle of <code>degrees</code>.</p></div></div><div class="field "><a name="playUISound"></a><h3 class="anchor"><code><span class="label label-meta label-meta-value" title="Used to store default values for fields and function arguments.">@:value({ volume : 1 })</span><span class="label label-static">static</span><a href="#playUISound"><span class="identifier">playUISound</span></a>(<span style="white-space:nowrap">soundName:<span class="type">String</span>,</span> <span style="white-space:nowrap">volume:<span class="type">Float</span> = 1</span>):<span class="type">Void</span></code></h3><div class="doc"><p>Plays a sound that persists between state changes.</p></div></div><div class="field "><a name="radiansToDegrees"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#radiansToDegrees"><span class="identifier">radiansToDegrees</span></a>(<span style="white-space:nowrap">radians:<span class="type">Float</span></span>):<span class="type">Float</span></code></h3><div class="doc"><p></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">This documentation is generated for version 0.1.4</p><p style="color:#000000">© 2024 <a style="color:#000000" href="https://themysticsword.itch.io/mechanism-that-brings-disaster">https://themysticsword.itch.io/mechanism-that-brings-disaster</a></p></div></div></footer><script src=".//highlighter.js"></script><link href="./highlighter.css" rel="stylesheet"/></body></html>