-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobjectinterface.html
More file actions
22 lines (22 loc) · 10.4 KB
/
objectinterface.html
File metadata and controls
22 lines (22 loc) · 10.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html SYSTEM "about:legacy-compat">
<html lang="en-US" data-preset="contrast" data-primary-color="#307FFF"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="robots" content="noindex"><meta name="built-on" content="2025-03-30T00:21:37.7249251"><title>ObjectInterface | YYC Toolbox Lua API</title><script type="application/json" id="virtual-toc-data">[{"id":"example","level":0,"title":"Example","anchor":"#example"},{"id":"name","level":0,"title":"Name","anchor":"#name"},{"id":"parent","level":0,"title":"Parent","anchor":"#parent"},{"id":"flags","level":0,"title":"Flags","anchor":"#flags"},{"id":"sprite","level":0,"title":"Sprite","anchor":"#sprite"},{"id":"depth","level":0,"title":"Depth","anchor":"#depth"},{"id":"mask","level":0,"title":"Mask","anchor":"#mask"},{"id":"id","level":0,"title":"ID","anchor":"#id"},{"id":"spawn","level":0,"title":"Spawn","anchor":"#spawn"},{"id":"destroy","level":0,"title":"Destroy","anchor":"#destroy"},{"id":"getinstances","level":0,"title":"GetInstances","anchor":"#getinstances"}]</script><script type="application/json" id="topic-shortcuts"></script><link href="https://resources.jetbrains.com/writerside/apidoc/6.22.0-b725/app.css" rel="stylesheet"><meta name="msapplication-TileColor" content="#000000"><link rel="apple-touch-icon" sizes="180x180" href="https://jetbrains.com/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="https://jetbrains.com/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="https://jetbrains.com/favicon-16x16.png"><meta name="msapplication-TileImage" content="https://resources.jetbrains.com/storage/ui/favicons/mstile-144x144.png"><meta name="msapplication-square70x70logo" content="https://resources.jetbrains.com/storage/ui/favicons/mstile-70x70.png"><meta name="msapplication-square150x150logo" content="https://resources.jetbrains.com/storage/ui/favicons/mstile-150x150.png"><meta name="msapplication-wide310x150logo" content="https://resources.jetbrains.com/storage/ui/favicons/mstile-310x150.png"><meta name="msapplication-square310x310logo" content="https://resources.jetbrains.com/storage/ui/favicons/mstile-310x310.png"><meta name="image" content=""><!-- Open Graph --><meta property="og:title" content="ObjectInterface | YYC Toolbox Lua API"><meta property="og:description" content=""><meta property="og:image" content=""><meta property="og:site_name" content="YYC Toolbox Lua API Help"><meta property="og:type" content="website"><meta property="og:locale" content="en_US"><meta property="og:url" content="writerside-documentation/objectinterface.html"><!-- End Open Graph --><!-- Twitter Card --><meta name="twitter:card" content="summary_large_image"><meta name="twitter:site" content=""><meta name="twitter:title" content="ObjectInterface | YYC Toolbox Lua API"><meta name="twitter:description" content=""><meta name="twitter:creator" content=""><meta name="twitter:image:src" content=""><!-- End Twitter Card --><!-- Schema.org WebPage --><script type="application/ld+json">{
"@context": "http://schema.org",
"@type": "WebPage",
"@id": "writerside-documentation/objectinterface.html#webpage",
"url": "writerside-documentation/objectinterface.html",
"name": "ObjectInterface | YYC Toolbox Lua API",
"description": "",
"image": "",
"inLanguage":"en-US"
}</script><!-- End Schema.org --><!-- Schema.org WebSite --><script type="application/ld+json">{
"@type": "WebSite",
"@id": "writerside-documentation/#website",
"url": "writerside-documentation/",
"name": "YYC Toolbox Lua API Help"
}</script><!-- End Schema.org --></head><body data-id="ObjectInterface" data-main-title="ObjectInterface" data-article-props="{"seeAlsoStyle":"links"}" data-template="article" data-breadcrumbs="API Reference///API.md|API"><div class="wrapper"><main class="panel _main"><header class="panel__header"><div class="container"><h3>YYC Toolbox Lua API Help</h3><div class="panel-trigger"></div></div></header><section class="panel__content"><div class="container"><article class="article" data-shortcut-switcher="inactive"><h1 data-toc="ObjectInterface" data-label-id="cs" id="ObjectInterface.md">ObjectInterface</h1><p id="x946rr_4">This class exposes most object properties and manipulator methods.</p><p id="x946rr_5">You can set any field of this class to an RValue, and it'll be the same as setting a variable for every instance of this object.</p><section class="chapter"><h2 id="example" data-toc="example">Example</h2><div class="code-block" data-lang="lua">
local engine = API.GetEngine()
local object = engine:GetObjectByName("obj_player")
object.x = 0 -- Set x of all obj_player instances to 0
object.y = 0 -- Set y of all obj_player instances to 0
-- You can set any variable you wish.
</div></section><section class="chapter"><h2 id="name" data-toc="name" data-annotation-ids="field">Name</h2><p> Type: <code class="code" id="x946rr_19">string</code></p><p id="x946rr_20">The name of the object. Writing to this field will overwrite the object's name.</p></section><section class="chapter"><h2 id="parent" data-toc="parent" data-annotation-ids="field,read">Parent</h2><p> Type: <code class="code" id="x946rr_23">ObjectInterface</code></p><p id="x946rr_24">The parent of the object. nil if none is present.</p></section><section class="chapter"><h2 id="flags" data-toc="flags" data-annotation-ids="field,read,unk">Flags</h2><p> Type: <code class="code" id="x946rr_28">int (bits)</code></p><p id="x946rr_29">The flags of the object.</p></section><section class="chapter"><h2 id="sprite" data-toc="sprite" data-annotation-ids="field">Sprite</h2><p> Type: <code class="code" id="x946rr_31">int</code></p><p id="x946rr_32">The sprite index for the object. Writing to this field will overwrite the object's sprite.</p></section><section class="chapter"><h2 id="depth" data-toc="depth" data-annotation-ids="field">Depth</h2><p> Type: <code class="code" id="x946rr_34">int</code></p><p id="x946rr_35">The depth for the object. Writing to this field will overwrite the object's depth.</p></section><section class="chapter"><h2 id="mask" data-toc="mask" data-annotation-ids="field,read,unk">Mask</h2><p> Type: <code class="code" id="x946rr_39">int</code></p><p id="x946rr_40">The mask of the object.</p></section><section class="chapter"><h2 id="id" data-toc="id" data-annotation-ids="field,read">ID</h2><p> Type: <code class="code" id="x946rr_43">int</code></p><p id="x946rr_44">The ID of the object.</p></section><section class="chapter"><h2 id="spawn" data-toc="spawn" data-annotation-ids="method,void">Spawn</h2><p> Spawns the object in the current room. </p><section class="chapter"><h3 id="spawn-args" data-toc="spawn-args">Arguments</h3><div class="table-wrapper"><table class="wide" id="x946rr_51"><thead><tr class="ijRowHead" id="x946rr_52"><th id="x946rr_57"><p>Name</p></th><th id="x946rr_58"><p>Type</p></th><th id="x946rr_59"><p>Description</p></th></tr></thead><tbody><tr id="x946rr_53"><td id="x946rr_60"><p><code class="code" id="x946rr_63">x</code></p></td><td id="x946rr_61"><p><code class="code" id="x946rr_64">int</code></p></td><td id="x946rr_62"><p>The X coordinate of the object's position.</p></td></tr><tr id="x946rr_54"><td id="x946rr_65"><p><code class="code" id="x946rr_68">y</code></p></td><td id="x946rr_66"><p><code class="code" id="x946rr_69">int</code></p></td><td id="x946rr_67"><p>The Y coordinate of the object's position.</p></td></tr><tr id="x946rr_55"><td id="x946rr_70"><p><code class="code" id="x946rr_73">layer</code></p></td><td id="x946rr_71"><p><code class="code" id="x946rr_74">string</code></p></td><td id="x946rr_72"><p>The name of the layer to spawn the object in. See remarks for more information.</p></td></tr><tr id="x946rr_56"><td id="x946rr_75"><p><code class="code" id="x946rr_78">room</code></p></td><td id="x946rr_76"><p><code class="code" id="x946rr_79">int</code></p></td><td id="x946rr_77"><p>The index of the room to spawn the object in. See remarks for more information.</p></td></tr></tbody></table></div></section><section class="chapter"><h3 id="remarks" data-toc="remarks">Remarks</h3></section><section class="chapter"><h3 id="layer" data-toc="layer" data-annotation-ids="opt">layer</h3><p> Default: 0 (<code class="code" id="x946rr_81">int</code>). </p><p id="x946rr_82">This parameter is ignored if the second optional parameter, <code class="code" id="x946rr_83">room</code>, is defined.</p></section><section class="chapter"><h3 id="room" data-toc="room" data-annotation-ids="opt">room</h3><p> Default: current room. </p><p id="x946rr_85">Including this parameter will place the object inside the target room at <code class="code" id="x946rr_86">X</code>, <code class="code" id="x946rr_87">Y</code> and override the layer to be 0 (<code class="code" id="x946rr_88">int</code>).</p></section></section><section class="chapter"><h2 id="destroy" data-toc="destroy" data-annotation-ids="method,void">Destroy</h2><p> Destroys the last instance of the object in the current room. </p><section class="chapter"><h3 id="Destroy-args" data-toc="Destroy-args">Arguments</h3><p id="x946rr_92">None</p></section></section><section class="chapter"><h2 id="getinstances" data-toc="getinstances" data-annotation-ids="method">GetInstances</h2><p> Get a table of all object instances in the current room. </p><section class="chapter"><h3 id="GetInstances-args" data-toc="GetInstances-args">Arguments</h3><p id="x946rr_96">None</p></section><section class="chapter"><h3 id="GetInstances-returns" data-toc="GetInstances-returns">Returns</h3><div class="table-wrapper"><table class="wide" id="x946rr_97"><thead><tr class="ijRowHead" id="x946rr_98"><th id="x946rr_100"><p>Type</p></th><th id="x946rr_101"><p>Description</p></th></tr></thead><tbody><tr id="x946rr_99"><td id="x946rr_102"><p><code class="code" id="x946rr_104">table (array of <a href="objectinstance.html" id="x946rr_105" data-tooltip="This class is a simple wrapper for object instances.">ObjectInstance</a>)</code></p></td><td id="x946rr_103"><p>The instances of the object in the current rom.</p></td></tr></tbody></table></div></section></section><div class="last-modified">Last modified: 29 March 2025</div><div data-feedback-placeholder="true"></div><div class="navigation-links _bottom"><a href="rvalue.html" class="navigation-links__prev">RValue</a><a href="objectinstance.html" class="navigation-links__next">ObjectInstance</a></div></article><div id="disqus_thread"></div></div></section></main></div><script src="https://resources.jetbrains.com/writerside/apidoc/6.22.0-b725/app.js"></script></body></html>