15 lines
14 KiB
HTML
15 lines
14 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../"><link rel="stylesheet" href="dmdoc.css"><title>/datum/parallax_holder - /tg/ Station 13</title></head><body><header><a href="index.html">/tg/ Station 13</a> - <a href="index.html#modules">Modules</a> - <a href="index.html#types">Types</a> — <a href="datum/parallax_holder.html#var">Var Details</a> - <a href="datum/parallax_holder.html#proc">Proc Details</a></header><main><h1>Parallax holders <aside>/<a href="datum.html">datum</a>/<a href="datum/parallax_holder.html">parallax_holder</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/_rendering/parallax/parallax_holder.dm#L13"><img src="git.png" width="16" height="16" title="code/_rendering/parallax/parallax_holder.dm 13"></a></h1><p>Holds all the information about a client's parallax</p>
|
||
<p>Not on mob because parallax is area based, not mob based.</p>
|
||
<p>How parallax works:</p>
|
||
<ul>
|
||
<li>Layers - normal layers, scroll with movement to relative position, can scroll</li>
|
||
<li>Absolute - absolute layers, scroll with movement to absolute position, cannot scroll</li>
|
||
<li>Vis - vis_contents-like model - things in this are directly applied and get no processing whatsoever. Things like overmap ships can use this.</li>
|
||
</ul><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="datum/parallax_holder.html#var/cached_eye">cached_eye</a></th><td>Eye we were last anchored to - used to detect eye changes</td></tr><tr><th><a href="datum/parallax_holder.html#var/forced_eye">forced_eye</a></th><td>force this eye as the "real" eye - useful for secondary maps</td></tr><tr><th><a href="datum/parallax_holder.html#var/last">last</a></th><td>last turf loc</td></tr><tr><th><a href="datum/parallax_holder.html#var/last_area">last_area</a></th><td>last area - for parallax scrolling/loop animations</td></tr><tr><th><a href="datum/parallax_holder.html#var/layers">layers</a></th><td>all layers</td></tr><tr><th><a href="datum/parallax_holder.html#var/owner">owner</a></th><td>Client that owns us</td></tr><tr><th><a href="datum/parallax_holder.html#var/parallax">parallax</a></th><td>The parallax object we're currently rendering</td></tr><tr><th><a href="datum/parallax_holder.html#var/planemaster_override">planemaster_override</a></th><td>override planemaster we manipulate for turning and other effects</td></tr><tr><th><a href="datum/parallax_holder.html#var/scroll_speed">scroll_speed</a></th><td>current scroll speed in DS per scroll</td></tr><tr><th><a href="datum/parallax_holder.html#var/scroll_turn">scroll_turn</a></th><td>current scroll turn - applied after angle. if angle is 0 (picture moving north) and turn is 90, it would be like if you turned your viewport 90 deg clockwise.</td></tr><tr><th><a href="datum/parallax_holder.html#var/scrolling">scrolling</a></th><td>currently scrolling?</td></tr><tr><th><a href="datum/parallax_holder.html#var/secondary_map">secondary_map</a></th><td>are we not on the main map? if so, put map id here</td></tr><tr><th><a href="datum/parallax_holder.html#var/vis">vis</a></th><td>vis contents</td></tr><tr><th><a href="datum/parallax_holder.html#var/vis_holder">vis_holder</a></th><td>Holder object for vis</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="datum/parallax_holder.html#proc/Animation">Animation</a></th><td>Runs a modifier to parallax as an animation.</td></tr><tr><th><a href="datum/parallax_holder.html#proc/Eye">Eye</a></th><td>Gets the eye we should be centered on</td></tr><tr><th><a href="datum/parallax_holder.html#proc/GetPlaneMaster">GetPlaneMaster</a></th><td>Gets the base parallax planemaster for things like turning</td></tr><tr><th><a href="datum/parallax_holder.html#proc/HardResetAnimations">HardResetAnimations</a></th><td>fully resets animation state</td></tr><tr><th><a href="datum/parallax_holder.html#proc/StopScrolling">StopScrolling</a></th><td>Smoothly stops the animation, turning to a certain angle as needed.</td></tr><tr><th><a href="datum/parallax_holder.html#proc/Sync">Sync</a></th><td>Syncs us to our parallax objects. Does NOT check if we should have those objects, that's Reset()'s job.</td></tr><tr><th><a href="datum/parallax_holder.html#proc/UpdateMotion">UpdateMotion</a></th><td>Updates motion if needed</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/cached_eye"><aside class="declaration">var </aside>cached_eye <aside>– /<a href="atom.html">atom</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/_rendering/parallax/parallax_holder.dm#L19"><img src="git.png" width="16" height="16" title="code/_rendering/parallax/parallax_holder.dm 19"></a></h3><p>Eye we were last anchored to - used to detect eye changes</p><h3 id="var/forced_eye"><aside class="declaration">var </aside>forced_eye <aside>– /<a href="atom.html">atom</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/_rendering/parallax/parallax_holder.dm#L21"><img src="git.png" width="16" height="16" title="code/_rendering/parallax/parallax_holder.dm 21"></a></h3><p>force this eye as the "real" eye - useful for secondary maps</p><h3 id="var/last"><aside class="declaration">var </aside>last <aside>– /<a href="turf.html">turf</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/_rendering/parallax/parallax_holder.dm#L23"><img src="git.png" width="16" height="16" title="code/_rendering/parallax/parallax_holder.dm 23"></a></h3><p>last turf loc</p><h3 id="var/last_area"><aside class="declaration">var </aside>last_area <aside>– /<a href="area.html">area</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/_rendering/parallax/parallax_holder.dm#L25"><img src="git.png" width="16" height="16" title="code/_rendering/parallax/parallax_holder.dm 25"></a></h3><p>last area - for parallax scrolling/loop animations</p><h3 id="var/layers"><aside class="declaration">var </aside>layers <aside>– /list/atom/movable/screen/parallax_layer</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/_rendering/parallax/parallax_holder.dm#L31"><img src="git.png" width="16" height="16" title="code/_rendering/parallax/parallax_holder.dm 31"></a></h3><p>all layers</p><h3 id="var/owner"><aside class="declaration">var </aside>owner <aside>– /<a href="client.html">client</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/_rendering/parallax/parallax_holder.dm#L15"><img src="git.png" width="16" height="16" title="code/_rendering/parallax/parallax_holder.dm 15"></a></h3><p>Client that owns us</p><h3 id="var/parallax"><aside class="declaration">var </aside>parallax <aside>– /<a href="datum.html">datum</a>/<a href="datum/parallax.html">parallax</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/_rendering/parallax/parallax_holder.dm#L17"><img src="git.png" width="16" height="16" title="code/_rendering/parallax/parallax_holder.dm 17"></a></h3><p>The parallax object we're currently rendering</p><h3 id="var/planemaster_override"><aside class="declaration">var </aside>planemaster_override <aside>– /<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/<a href="atom/movable/screen.html">screen</a>/plane_master/parallax</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/_rendering/parallax/parallax_holder.dm#L43"><img src="git.png" width="16" height="16" title="code/_rendering/parallax/parallax_holder.dm 43"></a></h3><p>override planemaster we manipulate for turning and other effects</p><h3 id="var/scroll_speed"><aside class="declaration">var </aside>scroll_speed <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/_rendering/parallax/parallax_holder.dm#L37"><img src="git.png" width="16" height="16" title="code/_rendering/parallax/parallax_holder.dm 37"></a></h3><p>current scroll speed in DS per scroll</p><h3 id="var/scroll_turn"><aside class="declaration">var </aside>scroll_turn <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/_rendering/parallax/parallax_holder.dm#L39"><img src="git.png" width="16" height="16" title="code/_rendering/parallax/parallax_holder.dm 39"></a></h3><p>current scroll turn - applied after angle. if angle is 0 (picture moving north) and turn is 90, it would be like if you turned your viewport 90 deg clockwise.</p><h3 id="var/scrolling"><aside class="declaration">var </aside>scrolling <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/_rendering/parallax/parallax_holder.dm#L35"><img src="git.png" width="16" height="16" title="code/_rendering/parallax/parallax_holder.dm 35"></a></h3><p>currently scrolling?</p><h3 id="var/secondary_map"><aside class="declaration">var </aside>secondary_map <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/_rendering/parallax/parallax_holder.dm#L29"><img src="git.png" width="16" height="16" title="code/_rendering/parallax/parallax_holder.dm 29"></a></h3><p>are we not on the main map? if so, put map id here</p><h3 id="var/vis"><aside class="declaration">var </aside>vis <aside>– /list/atom/movable</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/_rendering/parallax/parallax_holder.dm#L33"><img src="git.png" width="16" height="16" title="code/_rendering/parallax/parallax_holder.dm 33"></a></h3><p>vis contents</p><h3 id="var/vis_holder"><aside class="declaration">var </aside>vis_holder <aside>– /<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/<a href="atom/movable/screen.html">screen</a>/parallax_vis</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/_rendering/parallax/parallax_holder.dm#L27"><img src="git.png" width="16" height="16" title="code/_rendering/parallax/parallax_holder.dm 27"></a></h3><p>Holder object for vis</p><h2 id="proc">Proc Details</h2><h3 id="proc/Animation"><aside class="declaration">proc </aside>Animation<aside>(speed, turn, windup, turn_speed, force) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/_rendering/parallax/parallax_holder.dm#L224"><img src="git.png" width="16" height="16" title="code/_rendering/parallax/parallax_holder.dm 224"></a></aside></h3><p>Runs a modifier to parallax as an animation.</p>
|
||
<p>@params
|
||
speed - ds per loop
|
||
turn - angle clockwise from north to turn the motion to
|
||
windup - ds to spend on windups. 0 for immediate.
|
||
turn_speed - ds to spend on turning. 0 for immediate.</p><h3 id="proc/Eye"><aside class="declaration">proc </aside>Eye<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/_rendering/parallax/parallax_holder.dm#L122"><img src="git.png" width="16" height="16" title="code/_rendering/parallax/parallax_holder.dm 122"></a></aside></h3><p>Gets the eye we should be centered on</p><h3 id="proc/GetPlaneMaster"><aside class="declaration">proc </aside>GetPlaneMaster<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/_rendering/parallax/parallax_holder.dm#L128"><img src="git.png" width="16" height="16" title="code/_rendering/parallax/parallax_holder.dm 128"></a></aside></h3><p>Gets the base parallax planemaster for things like turning</p><h3 id="proc/HardResetAnimations"><aside class="declaration">proc </aside>HardResetAnimations<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/_rendering/parallax/parallax_holder.dm#L292"><img src="git.png" width="16" height="16" title="code/_rendering/parallax/parallax_holder.dm 292"></a></aside></h3><p>fully resets animation state</p><h3 id="proc/StopScrolling"><aside class="declaration">proc </aside>StopScrolling<aside>(turn, time) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/_rendering/parallax/parallax_holder.dm#L265"><img src="git.png" width="16" height="16" title="code/_rendering/parallax/parallax_holder.dm 265"></a></aside></h3><p>Smoothly stops the animation, turning to a certain angle as needed.</p><h3 id="proc/Sync"><aside class="declaration">proc </aside>Sync<aside>(auto_z_change, force) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/_rendering/parallax/parallax_holder.dm#L138"><img src="git.png" width="16" height="16" title="code/_rendering/parallax/parallax_holder.dm 138"></a></aside></h3><p>Syncs us to our parallax objects. Does NOT check if we should have those objects, that's Reset()'s job.</p>
|
||
<p>Doesn't move/update positions/screen locs either.</p>
|
||
<p>Also ensures movedirs are correct for the eye's pos.</p><h3 id="proc/UpdateMotion"><aside class="declaration">proc </aside>UpdateMotion<aside>(auto_z_change, force) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/_rendering/parallax/parallax_holder.dm#L152"><img src="git.png" width="16" height="16" title="code/_rendering/parallax/parallax_holder.dm 152"></a></aside></h3><p>Updates motion if needed</p></main><footer>tgstation.dme <a href="https://github.com/evilew/GS13-Citadel/tree/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e">e8e0068</a> (master) — <a href="https://github.com/SpaceManiac/SpacemanDMM/blob/master/crates/dmdoc/README.md">dmdoc 1.9.0</a></footer></body></html> |