You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creates an animated Lua Sprite using a spritesheet and its accompanying data file,
77
+
then stores it internally under the given <code>tag</code>.
78
+
</p>
79
+
70
80
<ul>
71
-
<li><b><spanclass="variablemarkup">tag</span></b> - Lua Sprite nametag to save.</li>
72
-
<li><b><spanclass="variablemarkup">image</span> (Optional)</b> - Image to display, don't include the extension!</li>
73
-
<li><b><spanclass="variablemarkup">x</span> (Optional)</b> - Defaults to 0.</li>
74
-
<li><b><spanclass="variablemarkup">y</span> (Optional)</b> - Defaults to 0.</li>
75
-
<li><b><spanclass="variablemarkup">spriteType</span> (Optional)</b> - Forces a spritesheet type, can be "sparrow" (.XML), "packer" (.TXT) or "aseprite" (.JSON). Defaults to "auto".</li>
81
+
<li>
82
+
<b><spanclass="variablemarkup">tag</span></b> –
83
+
Lua Sprite nametag used to reference and store the sprite.
84
+
Periods (<code>.</code>) are automatically stripped.
Caches frames immediately when loading the sprite, reducing runtime lag
124
+
at the cost of memory usage.
125
+
Defaults to <code>false</code>.
126
+
</li>
76
127
</ul>
128
+
77
129
<h4>Examples:</h4>
78
130
<ulclass="methoddiv">
79
-
<liclass="exampleitem"><spanclass="methodexample">makeAnimatedLuaSprite('mySprite', 'logoBumpin')</span> - Create a Lua Sprite with tag "mySprite" displaying <spanclass="methodexample">assets/shared/images/logoBumpin</span>, using its .PNG and .XML files.</li>
80
-
<liclass="exampleitem"><spanclass="methodexample">makeAnimatedLuaSprite('mySprite', 'aseprite-test', 0, 0, 'aseprite')</span> - Create a Lua Sprite with tag "mySprite" displaying <spanclass="methodexample">mods/My-Mod/images/aseprite-test</span>, using its .PNG and .JSON files.</li>
131
+
<liclass="exampleitem">
132
+
<spanclass="methodexample">
133
+
makeAnimatedLuaSprite('mySprite', 'logoBumpin')
134
+
</span> –
135
+
Creates an animated Lua Sprite using
136
+
<code>assets/shared/images/logoBumpin.png</code> and its XML data.
Creates a sprite and caches all frames immediately on load.
151
+
</li>
81
152
</ul>
82
-
<pstyle="color: gray">Note: You will still have to add the Lua Sprite to the scene with <ahref="#addLuaSprite">addLuaSprite</a> or it won't be visible.</p>
83
-
<pstyle="color: gray">Note 2: <ahref="https://github.com/ShadowMario/FNF-PsychEngine/wiki/Export-and-Import-from-Aseprite">Follow these instructions to export properly from Aseprite</a>.</p>
153
+
154
+
<pstyle="color: gray">
155
+
Note: You must still add the sprite to the scene using
156
+
<ahref="#addLuaSprite">addLuaSprite</a>, or it will not be visible.
0 commit comments