line based

This commit is contained in:
2025-09-18 22:13:58 -04:00
parent e1e17973d2
commit 5704c4de95
27 changed files with 5801 additions and 2572 deletions

View File

@@ -14,8 +14,15 @@ love_helper.graphics = {}
function love_helper.graphics.newFont(size)
-- Return a mock font object with basic methods
return {
getWidth = function(text)
return #text * size / 2
getWidth = function(self, text)
-- Handle both colon and dot syntax
if type(self) == "string" then
-- Called with dot syntax: font.getWidth(text)
return #self * size / 2
else
-- Called with colon syntax: font:getWidth(text)
return #text * size / 2
end
end,
getHeight = function()
return size
@@ -26,8 +33,15 @@ end
function love_helper.graphics.getFont()
-- Return a mock default font
return {
getWidth = function(text)
return #text * 12 / 2
getWidth = function(self, text)
-- Handle both colon and dot syntax
if type(self) == "string" then
-- Called with dot syntax: font.getWidth(text)
return #self * 12 / 2
else
-- Called with colon syntax: font:getWidth(text)
return #text * 12 / 2
end
end,
getHeight = function()
return 12