Add PlaceSprite
authoralmikes@aol.com
Wed, 31 Dec 2014 03:59:46 +0000
changeset 539 7173ac8996f9
parent 538 1ee51018a898
child 540 b41b9305be9f
Add PlaceSprite
LuaAPI.wiki
--- a/LuaAPI.wiki	Thu Dec 25 22:40:54 2014 +0000
+++ b/LuaAPI.wiki	Wed Dec 31 03:59:46 2014 +0000
@@ -784,6 +784,41 @@
 || 6 || long || vertical ||
 || 7 || long || increasing right ||
 
+==== <tt>!PlaceSprite(x, y, sprite, frameIdx, ...)</tt> ====
+Places a [Sprites sprite] at the specified position (`x`, `y`) on the map, it behaves like terrain then. `frameIdx` is the frame index starting by 0. This is used if the sprite consists of several sub-images. Only a subset of the sprites is currently supported by this function:
+
+ * `sprAmGirder`
+ * `sprAmRubber`
+ * `sprAMSlot`
+ * `sprAMAmmos`
+ * `sprAMAmmosBW`
+ * `sprAMCorners`
+ * `sprHHTelepMask`
+ * `sprTurnsLeft`
+ * `sprSpeechCorner`
+ * `sprSpeechEdge`
+ * `sprSpeechTail`
+ * `sprThoughtCorner`
+ * `sprThoughtEdge`
+ * `sprThoughtTail`
+ * `sprShoutCorner`
+ * `sprShoutEdge`
+ * `sprShoutTail`
+ * `sprSnow`
+ * `sprBotlevels`
+ * `sprIceTexture`
+ * `sprCustom1`
+ * `sprCustom2`
+
+The 5th and later arguments specify land flags (see data types) to be used for the newly created terrain. If omited, `lfNormal` is assumed.
+
+Example:
+
+<code language="lua">PlaceSprite(2836, 634, sprAmGirder, 5, lfNormal)
+-- Places the girder sprite as normal terrain at (2836, 634). The `frameIdx` 5 is for the long decreasing right girder.</code>
+<code language="lua">PlaceSprite(1411, 625, sprAmRubber, 1, lfBouncy)
+-- Places the rubber band sprite as bouncy terrain at (2836, 634). The `frameIdx` 1 is for the decreasing right rubber band.</code>
+
 ==== <tt>!AddPoint(x, y [, width [, erase] ])</tt> (0.9.21) ====
 This function is used to draw your own maps using Lua. The maps drawn with this are of type “hand-drawn”.