Sget
Jump to navigation
Jump to search
sget( x, y )
- Gets the color value of a pixel on the sprite sheet.
- x
-
- The x coordinate on the sprite sheet.
- y
-
- The y coordinate on the sprite sheet.
This is similar to pget()
except instead of the graphics buffer, it gets the color value from the sprite sheet. The sprite sheet is treated as a single canvas 128 pixels wide and 128 pixels high.
If the bottom half of the sprite sheet is used for map data, sget
will return map data values for that region. Prefer mget()
for accessing map data.
It will return 0 (black) if given coordinates outside the range (0-127,0-127).
Examples
sset(10, 10, 7) -- sets (10, 10) to white
print(sget(10, 10)) -- prints 7