This method adds an icon to the widget.
Parameter | Description |
---|---|
icon | icon to set |
alignment | pixmap alignment mode, may be PIXMAP_CENTER, PIXMAP_CONTAIN, PIXMAP_COVER, PIXMAP_STRETCH, or PIXMAP_FIT |
scale | icon scale |
local displays = GetDisplays()
-- Create a window
local window = CreateWindow("Ultra Engine", 0, 0, 800, 800, displays[1])
-- Create a user interface
local ui = CreateInterface(window)
-- Load an icon
local icon = LoadIcon("https://github.com/UltraEngine/Documentation/raw/master/Assets/Materials/Logos/23.svg")
-- Show the icon
ui.background:SetIcon(icon)
while true do
local ev = WaitEvent()
if ev.id == EVENT_WINDOWCLOSE then
return 0
end
end