<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://chronocrash.com/openbor/wiki/index.php?action=history&amp;feed=atom&amp;title=Ondrawscript</id>
	<title>Ondrawscript - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://chronocrash.com/openbor/wiki/index.php?action=history&amp;feed=atom&amp;title=Ondrawscript"/>
	<link rel="alternate" type="text/html" href="https://chronocrash.com/openbor/wiki/index.php?title=Ondrawscript&amp;action=history"/>
	<updated>2026-09-06T11:31:31Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://chronocrash.com/openbor/wiki/index.php?title=Ondrawscript&amp;diff=923&amp;oldid=prev</id>
		<title>Dcurrent at 03:09, 18 August 2026</title>
		<link rel="alternate" type="text/html" href="https://chronocrash.com/openbor/wiki/index.php?title=Ondrawscript&amp;diff=923&amp;oldid=prev"/>
		<updated>2026-08-18T03:09:25Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:09, 17 August 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l319&quot;&gt;Line 319:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 319:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Getentityproperty]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Getentityproperty]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Category:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Openborvariant&lt;/del&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;OpenBOR Index]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Script]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Script Events]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Graphics]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Model&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dcurrent</name></author>
	</entry>
	<entry>
		<id>https://chronocrash.com/openbor/wiki/index.php?title=Ondrawscript&amp;diff=922&amp;oldid=prev</id>
		<title>Dcurrent: /* Sprite Queue Behavior */</title>
		<link rel="alternate" type="text/html" href="https://chronocrash.com/openbor/wiki/index.php?title=Ondrawscript&amp;diff=922&amp;oldid=prev"/>
		<updated>2026-08-18T03:08:26Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Sprite Queue Behavior&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:08, 17 August 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l114&quot;&gt;Line 114:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 114:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Sprite Queue Behavior ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Sprite Queue Behavior ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Most script drawing functions add work to OpenBOR&#039;s central sprite queue. Common examples include &amp;lt;code&amp;gt;drawsprite()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;drawscreen()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;drawstring()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;drawbox()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;drawline()&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;drawdot()&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Most script drawing functions add work to OpenBOR&#039;s central sprite queue. Common examples include &amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;drawsprite()&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;drawscreen()&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;drawstring()&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;drawbox()&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;drawline()&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;drawdot()&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;OpenBOR renders the queue only after every Ondrawscript and the post-update scripts have finished. Script-added visuals therefore appear during the same refresh.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;OpenBOR renders the queue only after every Ondrawscript and the post-update scripts have finished. Script-added visuals therefore appear during the same refresh.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l120&quot;&gt;Line 120:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 120:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Queue insertion time does not by itself determine which visual appears on top. OpenBOR sorts items by their drawing Z value and then by &amp;lt;code&amp;gt;sortid&amp;lt;/code&amp;gt;. Items with identical sort values should not depend on insertion order as a stable tie-breaker.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Queue insertion time does not by itself determine which visual appears on top. OpenBOR sorts items by their drawing Z value and then by &amp;lt;code&amp;gt;sortid&amp;lt;/code&amp;gt;. Items with identical sort values should not depend on insertion order as a stable tie-breaker.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;code&amp;gt;drawsprite()&amp;lt;/code&amp;gt; accepts an optional &amp;lt;code&amp;gt;sortid&amp;lt;/code&amp;gt;, allowing precise placement among items sharing a drawing Z value. &amp;lt;code&amp;gt;drawscreen()&amp;lt;/code&amp;gt; and primitive queue functions such as &amp;lt;code&amp;gt;drawbox()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;drawline()&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;drawdot()&amp;lt;/code&amp;gt; use a sort ID of &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;, so their Z value is the primary creator-controlled layer.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;drawsprite()&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;&amp;lt;/code&amp;gt; accepts an optional &amp;lt;code&amp;gt;sortid&amp;lt;/code&amp;gt;, allowing precise placement among items sharing a drawing Z value. &amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;drawscreen()&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;&amp;lt;/code&amp;gt; and primitive queue functions such as &amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;drawbox()&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;drawline()&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;drawdot()&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;&amp;lt;/code&amp;gt; use a sort ID of &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;, so their Z value is the primary creator-controlled layer.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Text from &amp;lt;code&amp;gt;drawstring()&amp;lt;/code&amp;gt; is queued as font sprites at the font layer plus the supplied layer offset. Choose that offset according to the intended relationship with entity and interface graphics.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Text from &amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;drawstring()&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;&amp;lt;/code&amp;gt; is queued as font sprites at the font layer plus the supplied layer offset. Choose that offset according to the intended relationship with entity and interface graphics.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Direct-to-Screen Functions ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Direct-to-Screen Functions ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Functions whose names end in &amp;lt;code&amp;gt;toscreen&amp;lt;/code&amp;gt;, such as &amp;lt;code&amp;gt;drawspritetoscreen()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;drawboxtoscreen()&amp;lt;/code&amp;gt;, write to a supplied screen handle immediately instead of adding an item to the central queue. Their composition behavior differs from the normal queued functions and depends on the destination screen and when that screen is later used.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Functions whose names end in &amp;lt;code&amp;gt;toscreen&amp;lt;/code&amp;gt;, such as &amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;drawspritetoscreen()&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;drawboxtoscreen()&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;&amp;lt;/code&amp;gt;, write to a supplied screen handle immediately instead of adding an item to the central queue. Their composition behavior differs from the normal queued functions and depends on the destination screen and when that screen is later used.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Queued drawing is normally the clearest choice for visuals intended to participate in OpenBOR&amp;#039;s standard layer sorting.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Queued drawing is normally the clearest choice for visuals intended to participate in OpenBOR&amp;#039;s standard layer sorting.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l134&quot;&gt;Line 134:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 134:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The deferred timing also permits advanced manipulation of the completed queue:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The deferred timing also permits advanced manipulation of the completed queue:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;drawspriteq()&amp;lt;/code&amp;gt; renders selected queue contents to a screen before the engine&#039;s final queue render.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;drawspriteq()&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;&amp;lt;/code&amp;gt; renders selected queue contents to a screen before the engine&#039;s final queue render.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;clearspriteq()&amp;lt;/code&amp;gt; clears the shared queue rather than only the calling entity&#039;s entries.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;clearspriteq()&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;&amp;lt;/code&amp;gt; clears the shared queue rather than only the calling entity&#039;s entries.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Both functions affect global display state. Calling &amp;lt;code&amp;gt;clearspriteq()&amp;lt;/code&amp;gt; from one entity&#039;s Ondrawscript may remove queued backgrounds, native graphics for every entity, interface elements, and drawings added by earlier callbacks. Calling &amp;lt;code&amp;gt;drawspriteq()&amp;lt;/code&amp;gt; without a deliberate compositing plan may cause queue contents to be rendered again during the normal final pass.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Both functions affect global display state. Calling &amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;clearspriteq()&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;&amp;lt;/code&amp;gt; from one entity&#039;s Ondrawscript may remove queued backgrounds, native graphics for every entity, interface elements, and drawings added by earlier callbacks. Calling &amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;drawspriteq()&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;&amp;lt;/code&amp;gt; without a deliberate compositing plan may cause queue contents to be rendered again during the normal final pass.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Reserve direct queue management for systems intentionally replacing or capturing part of OpenBOR&amp;#039;s display composition.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Reserve direct queue management for systems intentionally replacing or capturing part of OpenBOR&amp;#039;s display composition.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l161&quot;&gt;Line 161:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 161:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Coordinates ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Coordinates ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Queue drawing functions use screen coordinates, while entity position properties use OpenBOR&#039;s world axes:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Queue drawing functions use &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Geometry Overview#Screen|&lt;/ins&gt;screen coordinates&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;, while entity position properties use OpenBOR&#039;s &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Geometry Overview#Game Field|&lt;/ins&gt;world axes&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* X - Horizontal world position.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* X - Horizontal world position.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l273&quot;&gt;Line 273:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 273:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;! Typical role&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;! Typical role&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| [[Update.c]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| [[&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Update|&lt;/ins&gt;Update.c]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Global pre-update script, called before logical entity processing when its update conditions are met.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Global pre-update script, called before logical entity processing when its update conditions are met.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Prepare global state, input-derived systems, and logic needed before native updates.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Prepare global state, input-derived systems, and logic needed before native updates.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l285&quot;&gt;Line 285:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 285:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Add or manage entity-linked display composition for the current refresh.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Add or manage entity-linked display composition for the current refresh.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| [[Updated.c]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| [[&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Updated|&lt;/ins&gt;Updated.c]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Global post-update script, called after the entity display pass and before final queue rendering.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Global post-update script, called after the entity display pass and before final queue rendering.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Finalize global state and add late display content after entity callbacks.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| Finalize global state and add late display content after entity callbacks.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l318&quot;&gt;Line 318:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 318:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Clearspriteq()]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Clearspriteq()]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Getentityproperty]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Getentityproperty]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Category:Openborvariant]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Category:Openborvariant]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dcurrent</name></author>
	</entry>
	<entry>
		<id>https://chronocrash.com/openbor/wiki/index.php?title=Ondrawscript&amp;diff=921&amp;oldid=prev</id>
		<title>Dcurrent: Created page with &quot;The &lt;code&gt;ondrawscript&lt;/code&gt; command defines a model-level display hook for each entity using that model. OpenBOR executes the script during an eligible display pass after it has queued the native visuals for every active entity, but before the sprite queue is rendered to the screen.  This timing makes Ondrawscript a powerful display-composition tool. Creators can add entity-anchored graphics, status indicators, procedural effects, custom attachments, trails, targeting...&quot;</title>
		<link rel="alternate" type="text/html" href="https://chronocrash.com/openbor/wiki/index.php?title=Ondrawscript&amp;diff=921&amp;oldid=prev"/>
		<updated>2026-08-18T02:57:15Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;The &amp;lt;code&amp;gt;ondrawscript&amp;lt;/code&amp;gt; command defines a model-level display hook for each entity using that model. OpenBOR executes the script during an eligible display pass after it has queued the native visuals for every active entity, but before the sprite queue is rendered to the screen.  This timing makes Ondrawscript a powerful display-composition tool. Creators can add entity-anchored graphics, status indicators, procedural effects, custom attachments, trails, targeting...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The &amp;lt;code&amp;gt;ondrawscript&amp;lt;/code&amp;gt; command defines a model-level display hook for each entity using that model. OpenBOR executes the script during an eligible display pass after it has queued the native visuals for every active entity, but before the sprite queue is rendered to the screen.&lt;br /&gt;
&lt;br /&gt;
This timing makes Ondrawscript a powerful display-composition tool. Creators can add entity-anchored graphics, status indicators, procedural effects, custom attachments, trails, targeting markers, replacement visuals, shadows, reflections, and diagnostic overlays without replacing the engine&amp;#039;s logical entity update.&lt;br /&gt;
&lt;br /&gt;
Despite its name, Ondrawscript is not limited to entities whose native sprite is currently visible. OpenBOR schedules the hook for every existing entity with an initialized Ondrawscript before testing blink visibility or the current sprite index. Off-screen entities and entities without a queueable current sprite may therefore execute it as well.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ondrawscript {path}&lt;br /&gt;
&lt;br /&gt;
# Default&lt;br /&gt;
# No corresponding Ondrawscript&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;{path}&amp;lt;/code&amp;gt; - Path to an OpenBOR Script source file.&lt;br /&gt;
* The command belongs in a model definition.&lt;br /&gt;
* OpenBOR loads and compiles the supplied script with the model.&lt;br /&gt;
* The source defines a normal &amp;lt;code&amp;gt;main()&amp;lt;/code&amp;gt; entry point.&lt;br /&gt;
* The script&amp;#039;s return value is ignored.&lt;br /&gt;
&lt;br /&gt;
Example model header:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
name example_character&lt;br /&gt;
type enemy&lt;br /&gt;
&lt;br /&gt;
ondrawscript data/scripts/example_draw.c&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Event code may also be embedded directly in the model:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; line&amp;gt;&lt;br /&gt;
ondrawscript @script&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
    void self = getlocalvar(&amp;quot;self&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    draw_entity_effects(self);&lt;br /&gt;
}&lt;br /&gt;
@end_script&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Local Variables ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Local&lt;br /&gt;
! Type&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt;&lt;br /&gt;
| Entity pointer&lt;br /&gt;
| Entity whose Ondrawscript is executing.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
No coordinates, animation index, drawing layer, sprite handle, draw method, screen handle, or visibility result is supplied automatically. Retrieve any needed state from &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt;, system properties, entity variables, or project-managed data.&lt;br /&gt;
&lt;br /&gt;
== Runtime Timing ==&lt;br /&gt;
&lt;br /&gt;
During a normal gameplay refresh, the relevant order is:&lt;br /&gt;
&lt;br /&gt;
# OpenBOR runs the global and level pre-update scripts and any required logical update cycles.&lt;br /&gt;
# The screen is cleared, then the level background, status display, and text objects are prepared.&lt;br /&gt;
# OpenBOR visits every existing entity in the active entity list.&lt;br /&gt;
# Each entity with an initialized Ondrawscript is placed on a deferred callback stack.&lt;br /&gt;
# Native entity visuals are added to the sprite queue, including applicable sprites, mirror images, shadows, status displays, and player indicators.&lt;br /&gt;
# Once every entity has been visited, OpenBOR executes the deferred Ondrawscript callbacks in active entity-list order.&lt;br /&gt;
# Global and level post-update scripts execute.&lt;br /&gt;
# OpenBOR sorts and renders the completed sprite queue.&lt;br /&gt;
# The finished screen is presented and the queue is cleared.&lt;br /&gt;
&lt;br /&gt;
The deliberate second pass is the feature&amp;#039;s defining behavior. Every native entity display item is already available in the queue before the first Ondrawscript begins, while script-added queue items still arrive in time for the current refresh.&lt;br /&gt;
&lt;br /&gt;
Logical updates and display passes are not one-to-one. One display pass may follow zero, one, or several logical update cycles. Ondrawscript executes once for each eligible entity during the display pass, not once for every logical cycle processed beforehand.&lt;br /&gt;
&lt;br /&gt;
== Execution Conditions ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Condition&lt;br /&gt;
! Executes?&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| Existing entity during an eligible display pass&lt;br /&gt;
| Yes&lt;br /&gt;
| The entity needs an initialized Ondrawscript.&lt;br /&gt;
|-&lt;br /&gt;
| Entity is frozen or logical updates did not advance it&lt;br /&gt;
| Yes&lt;br /&gt;
| Display scheduling is independent of whether the entity performed a logical update.&lt;br /&gt;
|-&lt;br /&gt;
| Entity is blinking and its native sprite is omitted for this refresh&lt;br /&gt;
| Yes&lt;br /&gt;
| Callback scheduling occurs before the blink test.&lt;br /&gt;
|-&lt;br /&gt;
| Current sprite index cannot be queued&lt;br /&gt;
| Yes&lt;br /&gt;
| Callback scheduling occurs before native sprite validation.&lt;br /&gt;
|-&lt;br /&gt;
| Entity is outside the visible viewport&lt;br /&gt;
| Yes&lt;br /&gt;
| No viewport test precedes callback scheduling.&lt;br /&gt;
|-&lt;br /&gt;
| Game is paused&lt;br /&gt;
| No&lt;br /&gt;
| The central entity display pass is skipped while pause is active.&lt;br /&gt;
|-&lt;br /&gt;
| Entity is spawned by another Ondrawscript&lt;br /&gt;
| Not until the next eligible display pass&lt;br /&gt;
| The deferred callback stack is complete before any Ondrawscript executes.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The same entity display path may also operate on active engine screens outside a level, such as selection, menu, scene, and other screens that use entities. Ondrawscript is consequently a display-pass hook rather than a level-only hook.&lt;br /&gt;
&lt;br /&gt;
== Sprite Queue Behavior ==&lt;br /&gt;
&lt;br /&gt;
Most script drawing functions add work to OpenBOR&amp;#039;s central sprite queue. Common examples include &amp;lt;code&amp;gt;drawsprite()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;drawscreen()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;drawstring()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;drawbox()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;drawline()&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;drawdot()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
OpenBOR renders the queue only after every Ondrawscript and the post-update scripts have finished. Script-added visuals therefore appear during the same refresh.&lt;br /&gt;
&lt;br /&gt;
Queue insertion time does not by itself determine which visual appears on top. OpenBOR sorts items by their drawing Z value and then by &amp;lt;code&amp;gt;sortid&amp;lt;/code&amp;gt;. Items with identical sort values should not depend on insertion order as a stable tie-breaker.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;drawsprite()&amp;lt;/code&amp;gt; accepts an optional &amp;lt;code&amp;gt;sortid&amp;lt;/code&amp;gt;, allowing precise placement among items sharing a drawing Z value. &amp;lt;code&amp;gt;drawscreen()&amp;lt;/code&amp;gt; and primitive queue functions such as &amp;lt;code&amp;gt;drawbox()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;drawline()&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;drawdot()&amp;lt;/code&amp;gt; use a sort ID of &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;, so their Z value is the primary creator-controlled layer.&lt;br /&gt;
&lt;br /&gt;
Text from &amp;lt;code&amp;gt;drawstring()&amp;lt;/code&amp;gt; is queued as font sprites at the font layer plus the supplied layer offset. Choose that offset according to the intended relationship with entity and interface graphics.&lt;br /&gt;
&lt;br /&gt;
=== Direct-to-Screen Functions ===&lt;br /&gt;
&lt;br /&gt;
Functions whose names end in &amp;lt;code&amp;gt;toscreen&amp;lt;/code&amp;gt;, such as &amp;lt;code&amp;gt;drawspritetoscreen()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;drawboxtoscreen()&amp;lt;/code&amp;gt;, write to a supplied screen handle immediately instead of adding an item to the central queue. Their composition behavior differs from the normal queued functions and depends on the destination screen and when that screen is later used.&lt;br /&gt;
&lt;br /&gt;
Queued drawing is normally the clearest choice for visuals intended to participate in OpenBOR&amp;#039;s standard layer sorting.&lt;br /&gt;
&lt;br /&gt;
=== Advanced Queue Control ===&lt;br /&gt;
&lt;br /&gt;
The deferred timing also permits advanced manipulation of the completed queue:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;drawspriteq()&amp;lt;/code&amp;gt; renders selected queue contents to a screen before the engine&amp;#039;s final queue render.&lt;br /&gt;
* &amp;lt;code&amp;gt;clearspriteq()&amp;lt;/code&amp;gt; clears the shared queue rather than only the calling entity&amp;#039;s entries.&lt;br /&gt;
&lt;br /&gt;
Both functions affect global display state. Calling &amp;lt;code&amp;gt;clearspriteq()&amp;lt;/code&amp;gt; from one entity&amp;#039;s Ondrawscript may remove queued backgrounds, native graphics for every entity, interface elements, and drawings added by earlier callbacks. Calling &amp;lt;code&amp;gt;drawspriteq()&amp;lt;/code&amp;gt; without a deliberate compositing plan may cause queue contents to be rendered again during the normal final pass.&lt;br /&gt;
&lt;br /&gt;
Reserve direct queue management for systems intentionally replacing or capturing part of OpenBOR&amp;#039;s display composition.&lt;br /&gt;
&lt;br /&gt;
== Native Visual State Is Already Queued ==&lt;br /&gt;
&lt;br /&gt;
OpenBOR prepares an entity&amp;#039;s native sprite and related display items before any Ondrawscript executes. Changes made to native visual state during the callback are therefore generally too late to alter items already queued for the current refresh.&lt;br /&gt;
&lt;br /&gt;
Examples include changing:&lt;br /&gt;
&lt;br /&gt;
* Position or facing.&lt;br /&gt;
* Current animation or animation index.&lt;br /&gt;
* Color map or alpha.&lt;br /&gt;
* Draw method properties.&lt;br /&gt;
* Native shadow configuration.&lt;br /&gt;
* Native sprite selection.&lt;br /&gt;
* Layer or sort ID used by the already queued sprite.&lt;br /&gt;
&lt;br /&gt;
Such changes can affect later refreshes and may influence script-added drawing immediately, but they do not retroactively rebuild the native queue entry. Use an earlier logical hook when the native sprite itself must be changed for the current display pass. Use drawing functions inside Ondrawscript when the desired graphic should be added immediately.&lt;br /&gt;
&lt;br /&gt;
This distinction supports deliberate overlay and replacement techniques. Projects may suppress native rendering through earlier state or model configuration, then use Ondrawscript to submit a custom visual. Merely changing the entity to an invisible state inside Ondrawscript does not remove the native sprite that was already queued.&lt;br /&gt;
&lt;br /&gt;
== Coordinates ==&lt;br /&gt;
&lt;br /&gt;
Queue drawing functions use screen coordinates, while entity position properties use OpenBOR&amp;#039;s world axes:&lt;br /&gt;
&lt;br /&gt;
* X - Horizontal world position.&lt;br /&gt;
* Z - World depth and the basis of normal entity drawing order.&lt;br /&gt;
* Y - Vertical altitude. Legacy script interfaces may call this axis A.&lt;br /&gt;
&lt;br /&gt;
Native entity display converts world position to screen position by subtracting the current camera position, combining depth and altitude for screen Y, and applying applicable screen-shake offsets. Entities configured to ignore their own quake offset use a slightly different conversion.&lt;br /&gt;
&lt;br /&gt;
Ondrawscript does not receive the native conversion result. Projects that attach several custom elements to entities benefit from a shared helper that performs the same world-to-screen conversion and respects vertical scrolling and quake configuration.&lt;br /&gt;
&lt;br /&gt;
Compact entity-anchored marker example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; line&amp;gt;&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
    void self = getlocalvar(&amp;quot;self&amp;quot;);&lt;br /&gt;
    int screen_x = entity_screen_x(self);&lt;br /&gt;
    int screen_y = entity_screen_y(self);&lt;br /&gt;
    int layer = entity_display_layer(self) + 1;&lt;br /&gt;
&lt;br /&gt;
    draw_status_marker(screen_x, screen_y - 48, layer);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The helper names in this example represent project functions. Keeping coordinate conversion and layer selection in shared helpers avoids repeating camera, shake, set-layer, platform, and other display-order rules throughout model scripts.&lt;br /&gt;
&lt;br /&gt;
== Practical Uses ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Pattern&lt;br /&gt;
! Use of &amp;lt;code&amp;gt;ondrawscript&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Status visualization&lt;br /&gt;
| Draw poison, armor, stun, charge, targeting, team, objective, or interaction indicators anchored to the entity.&lt;br /&gt;
|-&lt;br /&gt;
| Custom attachments&lt;br /&gt;
| Draw weapons, equipment, aura components, modular body pieces, or costume layers selected from live entity state.&lt;br /&gt;
|-&lt;br /&gt;
| Procedural effects&lt;br /&gt;
| Add glows, trails, afterimages, motion lines, shadows, reflections, or generated shapes without adding each result to the native animation data.&lt;br /&gt;
|-&lt;br /&gt;
| Replacement rendering&lt;br /&gt;
| Submit a project-controlled visual for entities whose native display was suppressed through an earlier hook or model configuration.&lt;br /&gt;
|-&lt;br /&gt;
| Entity-linked interface&lt;br /&gt;
| Position names, gauges, prompts, damage previews, or contextual commands over world objects.&lt;br /&gt;
|-&lt;br /&gt;
| Diagnostics&lt;br /&gt;
| Visualize collision boxes, range checks, origins, paths, targets, ownership, binding offsets, movement vectors, or AI state.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Conditional Status Graphic ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; line&amp;gt;&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
    void self = getlocalvar(&amp;quot;self&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    if(getentityvar(self, &amp;quot;poisoned&amp;quot;))&lt;br /&gt;
    {&lt;br /&gt;
        draw_poison_indicator(self);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Project helper &amp;lt;code&amp;gt;draw_poison_indicator()&amp;lt;/code&amp;gt; can select the graphic, convert the entity position, and choose a layer above the native sprite. The callback itself remains focused on deciding when the indicator belongs in the display.&lt;br /&gt;
&lt;br /&gt;
=== Layered Attachment and Trail ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; line&amp;gt;&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
    void self = getlocalvar(&amp;quot;self&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    draw_entity_trail(self);&lt;br /&gt;
    draw_equipment_layers(self);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separate helpers can place trail elements behind the entity and equipment elements above it by submitting different Z and &amp;lt;code&amp;gt;sortid&amp;lt;/code&amp;gt; values. Callback order alone should not be used to establish those relationships.&lt;br /&gt;
&lt;br /&gt;
=== Collision Diagnostics ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; line&amp;gt;&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
    void self = getlocalvar(&amp;quot;self&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    if(getglobalvar(&amp;quot;show_collision_debug&amp;quot;))&lt;br /&gt;
    {&lt;br /&gt;
        draw_entity_collision_debug(self);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This pattern allows a project-wide switch to reveal collision boxes, attack boxes, entity origins, or other runtime geometry for every model that includes the hook.&lt;br /&gt;
&lt;br /&gt;
== Callback Ordering and Shared State ==&lt;br /&gt;
&lt;br /&gt;
Deferred callbacks execute in active entity-list order. This order generally reflects internal entity allocation, not visual depth, player priority, or model declaration order. Spawning and removal can also change it over time.&lt;br /&gt;
&lt;br /&gt;
Use queue Z and &amp;lt;code&amp;gt;sortid&amp;lt;/code&amp;gt; for visual ordering. Use explicit project state when one entity&amp;#039;s callback must exchange information with another. Logic whose result affects gameplay should normally live in an update or event hook rather than depending on display-callback order.&lt;br /&gt;
&lt;br /&gt;
Since every qualifying entity may execute code on every display pass, costly full-entity searches, repeated resource setup, file access, or unnecessary array construction can scale quickly. Cache stable data and keep routine display work bounded where practical.&lt;br /&gt;
&lt;br /&gt;
== Comparison with Other Update Hooks ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Hook&lt;br /&gt;
! Scope and timing&lt;br /&gt;
! Typical role&lt;br /&gt;
|-&lt;br /&gt;
| [[Update.c]]&lt;br /&gt;
| Global pre-update script, called before logical entity processing when its update conditions are met.&lt;br /&gt;
| Prepare global state, input-derived systems, and logic needed before native updates.&lt;br /&gt;
|-&lt;br /&gt;
| [[Animationscript]]&lt;br /&gt;
| Model animation-index update hook, called when an entity enters or is moved to an indexed animation position.&lt;br /&gt;
| Implement animation actions, branches, state transitions, and indexed-position behavior.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ondrawscript&amp;lt;/code&amp;gt;&lt;br /&gt;
| Per-entity display callback, deferred until native visuals for all entities have entered the queue.&lt;br /&gt;
| Add or manage entity-linked display composition for the current refresh.&lt;br /&gt;
|-&lt;br /&gt;
| [[Updated.c]]&lt;br /&gt;
| Global post-update script, called after the entity display pass and before final queue rendering.&lt;br /&gt;
| Finalize global state and add late display content after entity callbacks.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Ondrawscript should not be used as a substitute for deterministic gameplay updates. Display refresh frequency can differ from logical update frequency, the hook does not run while paused, and entities outside the viewport still qualify. Gameplay timers, movement, damage, AI, and collision decisions belong in logical or event-driven hooks unless they are intentionally coupled to display passes.&lt;br /&gt;
&lt;br /&gt;
== Common Mistakes ==&lt;br /&gt;
&lt;br /&gt;
* Assuming the callback runs only when &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt;&amp;#039;s sprite is visible.&lt;br /&gt;
* Treating one callback as one logical game update.&lt;br /&gt;
* Moving or hiding &amp;lt;code&amp;gt;self&amp;lt;/code&amp;gt; and expecting its already queued native sprite to change immediately.&lt;br /&gt;
* Supplying world coordinates directly to screen-space drawing functions.&lt;br /&gt;
* Ignoring camera, vertical-scroll, altitude, or quake offsets when anchoring graphics.&lt;br /&gt;
* Assuming later drawing calls always appear above earlier queue entries.&lt;br /&gt;
* Depending on entity-list callback order for visual layering or gameplay logic.&lt;br /&gt;
* Clearing the shared sprite queue when only one entity&amp;#039;s custom graphic should be removed.&lt;br /&gt;
* Performing expensive global searches independently from every entity on every display pass.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Animationscript]]&lt;br /&gt;
* [[Update]]&lt;br /&gt;
* [[Updated]]&lt;br /&gt;
* [[Drawsprite()]]&lt;br /&gt;
* [[Drawscreen()]]&lt;br /&gt;
* [[Drawstring()]]&lt;br /&gt;
* [[Drawbox()]]&lt;br /&gt;
* [[Drawline()]]&lt;br /&gt;
* [[Drawdot()]]&lt;br /&gt;
* [[Drawspriteq()]]&lt;br /&gt;
* [[Clearspriteq()]]&lt;br /&gt;
* [[Getentityproperty]]&lt;br /&gt;
* [[Category:Openborvariant]]&lt;/div&gt;</summary>
		<author><name>Dcurrent</name></author>
	</entry>
</feed>