Commands/Lua

Reference for console commands, Lua hooks and Lua commands in CS2D.

CS2D Command CS2D Console Commands

Lua Hook Lua Hooks

Lua Command Lua Commands

Lua Command imagepos

Categories

Parameters

  • id
  • x
  • y
  • rot

Info

Changes the position (x & y, pixels) and rotation (rot, 0°-360°) of an image.

Note: x and y are the position in pixels on the map (with 0|0 being top left)

Note: rot is the rotation in degrees (0-360, 0 for no rotation = default for new images)

Note: depending on the image mode x/y/rot may have a special meaning (see image for details)


Sample 1: Creating an image and changing its look and position/rotation
local id=image("gfx/sprites/flare2.bmp",0,0,2)
imagecolor(id,255,255,0)
imageblend(id,1)
imagealpha(id,0.5)
imagescale(id,2,3)
imagepos(id,30,30,45)