User Tools

Site Tools


ixe:irpl:sprites:createsprite

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ixe:irpl:sprites:createsprite [2025/01/11 00:03] – [CreateSprite] Argonwolfixe:irpl:sprites:createsprite [2025/02/14 14:57] (current) – external edit 127.0.0.1
Line 5: Line 5:
  
 ===== Description ===== ===== Description =====
-Creates a sprite with image at world position Returns the UID for the sprite.+Creates a sprite with image and origin. Origin is a V2 that represents the sprite's pivot point as a fraction of its size. For instance, an origin of (0,0) causes the sprite to pivot around its bottom-left corner, while an origin of (0.5,0.5) causes it to pivot around its center. Returns the UID for the sprite.
  
 ===== Examples ===== ===== Examples =====
-<code irpl>+<code 4rpl> 
 +#Spawning a default enemy sprite and moving it to 100,100 
 +CreateSprite("$/beast/beast.png" v2(0.5 0.5)) ->sprite 
 +SetSpritePosition(<-sprite v2(100 100) 0) 
 + 
 +#spawning a custom sprite from the map's editor directory 
 +CreateSprite("/custom4.png" v2(0.5 0.5))
 </code> </code>
ixe/irpl/sprites/createsprite.1736553796.txt.gz · Last modified: 2025/02/14 14:56 (external edit)