Font:getTextSize : howto?

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
the underminer
Posts: 123
Joined: Mon Oct 03, 2005 4:25 am
Location: Netherlands

Font:getTextSize : howto?

Post by the underminer »

It seems to return a table. I thought this would be a table with two values: x an y size. But when I do this:

Code: Select all

print(ActFont:getTextSize(BonusTXT[LastB+1])[1])
the result is nil. When I try this:

Code: Select all

print(ActFont:getTextSize(BonusTXT[LastB+1])[width])
the result is nil too. Who knows how to get the width or x-size from this function?
Behold! The Underminer got hold of a PSP
the underminer
Posts: 123
Joined: Mon Oct 03, 2005 4:25 am
Location: Netherlands

Post by the underminer »

I already found out myself: I forgot the quotation marks. Should be

Code: Select all

ActFont:getTextSize(BonusTXT[LastB+1])["width"]
for the height, you probably need ["height"]
Behold! The Underminer got hold of a PSP
Post Reply