is returning a single value (not a w/h pair)

Using SDK 1.12.0

Problem: and seem to return only a single integer value.

I've tried both and but both exhibit the behavior. The getSize call returns what just appears to be the width of the image. Happy to send along the image if it's image specific.

Sample code:
function main()
local image ="resources/images/splash.png")
if image ~= nil then
local size = image:getSize()
local w = size.width -- CRASH HERE

Try this:

local w, h = myImage:getSize()

Ah, thank you! That wasn't a Lua syntax I was familiar with. Happy to learn something new!

1 Like