Dev - Lua Libraries
Lua Command: s3sprite.getImageSize
Parameters
- int imageID
Return Values
Signature
Description
Gets the width and height of the image with the the given imageID in pixels. It is either equal to the rectW/rectH used in s3sprite.load or it is equal to the full image size if no custom rect was specified in s3sprite.load.
width and height will both be 0 if the given image does not exist.
width and height will both be 0 if the given image does not exist.
Example:
Print the width and height of an image1
2
3
2
3
cursor = s3sprite.load("interface/cursor.png")
w, h = s3sprite.getImageSize(cursor)
print("image with ID " .. cursor .. " has a size of " .. w .. " x " .. h .. "pixels!")
w, h = s3sprite.getImageSize(cursor)
print("image with ID " .. cursor .. " has a size of " .. w .. " x " .. h .. "pixels!")