Commands/Lua
Reference for console commands, Lua hooks and Lua commands in CS2D.
- Console Commands are entered in console, executed with key-binds, cfg-files or with Lua parse
- Lua Hooks execute Lua when events occur - some have a return value which can change the game behavior
- Lua Commands are used to retrieve game data or to perform actions in Lua scripts
CS2D Console Commands
Lua Hooks
Lua Commands
imageposCategories
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)
Categories
Parameters
- id
- x
- y
- rot
Info
Changes the position (x & y, pixels) and rotation (rot, 0°-360°) of an image.
Sample 1: Creating an image and changing its look and position/rotation
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)
imagecolor(id,255,255,0)
imageblend(id,1)
imagealpha(id,0.5)
imagescale(id,2,3)
imagepos(id,30,30,45)