Every plan includes the Lua API, so you can build exactly the behavior you want on top of your upgrade.
-- Adds a menu page, then reads its controls every frame.
script.api_version(1)
ui.create_tab("Hello")
ui.create_toggle("show", "Show text", true)
ui.create_slider_int("x", "Position", 0, 1920, 100)
script.on("render", function()
if ui.get("show") then
draw.text(ui.get("x"), 100, "Hello from Polarity!", {1, 1, 1, 1})
end
end)
-- Use an absolute path or a path relative to this script's directory.
local font, error = assets.load_font([[C:\Windows\Fonts\segoeui.ttf]], 24)
if not font then print(error) end
script.on("render", function()
-- A nil handle falls back to the default overlay font.
draw.text(100, 100, "Hello from a custom font!", {1, 1, 1, 1}, font)
end)
-- Put image.png next to this script.
local image, width, height = assets.load_image("image.png")
if not image then
print(width) -- on failure, the second value is the error message
end
script.on("render", function()
if image then
-- White keeps the image's own colors.
draw.image(image, 100, 100, width, height, { 1, 1, 1, 1 })
end
end)