Files
CodenameEngine/pages/funkin/system/CoolUtil.html
T
2022-10-26 17:13:08 +02:00

10 lines
14 KiB
HTML

<!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>funkin.system.CoolUtil</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> CoolUtil</h1><h4><small>package <a href="../../funkin/system/index.html">funkin.system</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 variables</h3><div class="fields"><div class="field "><a name="difficultyArray"></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([&quot;EASY&quot;, &quot;NORMAL&quot;, &quot;HARD&quot;])</span><span class="label label-static">static</span><a href="#difficultyArray"><span class="identifier">difficultyArray</span></a>:<span class="type">Array</span>&lt;<span class="type">String</span>&gt;<span> = [&quot;EASY&quot;, &quot;NORMAL&quot;, &quot;HARD&quot;]</span></code></h3><div class="doc"><p></p></div></div></div><h3 class="section">Static methods</h3><div class="fields"><div class="field "><a name="cameraCenter"></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({ axes : XY })</span><span class="label label-static">static</span><a href="#cameraCenter"><span class="identifier">cameraCenter</span></a>(<span style="white-space:nowrap">obj:<span class="type">FlxObject</span>,</span> <span style="white-space:nowrap">cam:<span class="type">FlxCamera</span>,</span> <span style="white-space:nowrap">axes:<span class="type">FlxAxes</span> = XY</span>):<span class="type">Void</span></code></h3><div class="doc"><p></p></div></div><div class="field "><a name="coolTextFile"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#coolTextFile"><span class="identifier">coolTextFile</span></a>(<span style="white-space:nowrap">path:<span class="type">String</span></span>):<span class="type">Array</span>&lt;<span class="type">String</span>&gt;</code></h3><div class="doc"><p></p></div></div><div class="field "><a name="difficultyString"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#difficultyString"><span class="identifier">difficultyString</span></a>():<span class="type">String</span></code></h3><div class="doc"><p></p></div></div><div class="field "><a name="fpsLerp"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#fpsLerp"><span class="identifier">fpsLerp</span></a>(<span style="white-space:nowrap">v1:<span class="type">Float</span>,</span> <span style="white-space:nowrap">v2:<span class="type">Float</span>,</span> <span style="white-space:nowrap">ratio:<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="getColorFromDynamic"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#getColorFromDynamic"><span class="identifier">getColorFromDynamic</span></a>(<span style="white-space:nowrap">c:<span class="type">Dynamic</span></span>):<span class="type">Null</span>&lt;<span class="type">FlxColor</span>&gt;</code></h3><div class="doc"><p>Tries to get a color from a <code>Dynamic</code> variable.</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th style="width:25%;"><code>c</code></th><td><p><code>Dynamic</code> color.</p></td></tr></table><p class="javadoc">Returns:</p><div class="indent inline-content"><p>The result color, or <code>null</code> if invalid.</p></div></div></div><div class="field "><a name="getDefault"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#getDefault"><span class="identifier">getDefault</span></a>&lt;<span class="type">T</span>&gt;(<span style="white-space:nowrap">v:<span class="type">T</span>,</span> <span style="white-space:nowrap">defaultValue:<span class="type">T</span></span>):<span class="type">T</span></code></h3><div class="doc"><p>Returns <code>v</code> if not null, <code>defaultValue</code> otherwise.</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th style="width:25%;"><code>v</code></th><td><p>The value</p></td></tr><tr><th style="width:25%;"><code>defaultValue</code></th><td><p>The default value</p></td></tr></table><p class="javadoc">Returns:</p><div class="indent inline-content"><p>The return value</p></div></div></div><div class="field "><a name="getFPSRatio"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#getFPSRatio"><span class="identifier">getFPSRatio</span></a>(<span style="white-space:nowrap">ratio:<span class="type">Float</span></span>):<span class="type">Float</span></code></h3><div class="doc"><p>Modifies a lerp ratio based on current FPS to keep a stable speed on higher framerate.</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th style="width:25%;"><code>ratio</code></th><td><p>Ratio</p></td></tr></table><p class="javadoc">Returns:</p><div class="indent inline-content"><p>FPS-Modified Ratio</p></div></div></div><div class="field "><a name="getSizeString"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#getSizeString"><span class="identifier">getSizeString</span></a>(<span style="white-space:nowrap">size:<span class="type">UInt</span></span>):<span class="type">String</span></code></h3><div class="doc"><p></p></div></div><div class="field "><a name="keyToString"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#keyToString"><span class="identifier">keyToString</span></a>(<span style="white-space:nowrap">key:<span class="type">Null</span>&lt;<span class="type">FlxKey</span>&gt;</span>):<span class="type">String</span></code></h3><div class="doc"><p></p></div></div><div class="field "><a name="last"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#last"><span class="identifier">last</span></a>&lt;<span class="type">T</span>&gt;(<span style="white-space:nowrap">array:<span class="type">Array</span>&lt;<span class="type">T</span>&gt;</span>):<span class="type">T</span></code></h3><div class="doc"><p>Returns last member of array</p></div></div><div class="field "><a name="lerpColor"></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({ fpsSensitive : false })</span><span class="label label-static">static</span><a href="#lerpColor"><span class="identifier">lerpColor</span></a>(<span style="white-space:nowrap">color1:<span class="type">FlxColor</span>,</span> <span style="white-space:nowrap">color2:<span class="type">FlxColor</span>,</span> <span style="white-space:nowrap">ratio:<span class="type">Float</span>,</span> <span style="white-space:nowrap">fpsSensitive:<span class="type">Bool</span> = false</span>):<span class="type">FlxColor</span></code></h3><div class="doc"><p>Lerps from color1 into color2 (Shortcut to <code>FlxColor.interpolate</code>)</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th style="width:25%;"><code>color1</code></th><td><p>Color 1</p></td></tr><tr><th style="width:25%;"><code>color2</code></th><td><p>Color 2</p></td></tr><tr><th style="width:25%;"><code>ratio</code></th><td><p>Ratio</p></td></tr><tr><th style="width:25%;"><code>fpsSensitive</code></th><td><p>Whenever the ratio should be case sentivive (adapted when game is running at 120 instead of 60)</p></td></tr></table></div></div><div class="field "><a name="numberArray"></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({ min : 0 })</span><span class="label label-static">static</span><a href="#numberArray"><span class="identifier">numberArray</span></a>(<span style="white-space:nowrap">max:<span class="type">Int</span>,</span> <span style="white-space:nowrap">min:<span class="type">Int</span> = 0</span>):<span class="type">Array</span>&lt;<span class="type">Int</span>&gt;</code></h3><div class="doc"><p></p></div></div><div class="field "><a name="playMenuSFX"></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, menuSFX : 0 })</span><span class="label label-static">static</span><a href="#playMenuSFX"><span class="identifier">playMenuSFX</span></a>(<span style="white-space:nowrap">menuSFX:<span class="type">Int</span> = 0,</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 specified Menu SFX.</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th style="width:25%;"><code>menuSFX</code></th><td><p>Menu SFX to play</p></td></tr><tr><th style="width:25%;"><code>volume</code></th><td><p>At which volume it should play</p></td></tr></table></div></div><div class="field "><a name="setSpriteSize"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#setSpriteSize"><span class="identifier">setSpriteSize</span></a>(<span style="white-space:nowrap">sprite:<span class="type">FlxSprite</span>,</span> <span style="white-space:nowrap">width:<span class="type">Float</span>,</span> <span style="white-space:nowrap">height:<span class="type">Float</span></span>):<span class="type">Void</span></code></h3><div class="doc"><p></p></div></div><div class="field "><a name="setUnstretchedGraphicSize"></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({ fill : true })</span><span class="label label-static">static</span><a href="#setUnstretchedGraphicSize"><span class="identifier">setUnstretchedGraphicSize</span></a>(<span style="white-space:nowrap">sprite:<span class="type">FlxSprite</span>,</span> <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 style="white-space:nowrap">fill:<span class="type">Bool</span> = true</span>):<span class="type">Void</span></code></h3><div class="doc"><p></p></div></div><div class="field "><a name="switchAnimFrames"></a><h3 class="anchor"><code><span class="label label-static">static</span><a href="#switchAnimFrames"><span class="identifier">switchAnimFrames</span></a>(<span style="white-space:nowrap">anim1:<span class="type">FlxAnimation</span>,</span> <span style="white-space:nowrap">anim2:<span class="type">FlxAnimation</span></span>):<span class="type">Void</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">&copy; 2022 &nbsp;</p></div></div></footer><script src="../..//highlighter.js"></script><link href="../../highlighter.css" rel="stylesheet"/></body></html>