Ok, can someone tell me where I am screwing up here. I have been banging my head against the wall far to long just trying to render some text in a window. I can display a panel, and other stuff, but the text is just killing me.
require "ISUI/ISUIElement"
CommWindow = ISUIElement:derive("CommWindow")
function CommWindow:initialise()
ISUIElement.initialise(self)
end
function CommWindow:render()
ISUIElement.render(self)
-- Example text rendering
local text = "Hello, World!"
local x, y = 10, 10 -- Text position
local r, g, b, a = 1, 1, 1, 1 -- Text color (white)
local font = UIFont.Small -- Default small font
self:DrawText(text, x, y, r, g, b, a, font)
end
function CommWindow:new(x, y, width, height)
local o = ISUIElement.new(self, x, y, width, height)
setmetatable(o, self)
self.__index = self
return o
end
Events.OnGameStart.Add(function()
local myCommWindow = CommWindow:new(100, 100, 300, 200)
myCommWindow:addToUIManager() -- Assuming there is a method to add it to the UI manager
end)
it errors out on self:DrawText(text, x, y, r, g, b, a, font) when loading into the game....