SDK 2.0 b2 - playdate.display.getSize() returns only width?

,

When calling playdate.display.getSize(), it seems to return a flat number 400. Had expected {width = 400, height = 240} as per the documentation.


Disclaimer: I’m a complete newbie.

It forms a somewhat strange thing called a tuple, which is multiple individual values.
Notice the normal brackets ( width, height) in the docs.
Returning a table would use brackets like these { width, height }.

You can do:

local w,h = playdate.display.getSize()
print(w,h)

or:

local wh = table.pack( playdate.display.getSize() )
printTable(wh)
2 Likes