This function is used to create a new window.
Parameter | Description |
---|---|
title | text to display in the titlebar |
x | initial x position of the window |
y | initial y position of the window |
width | initial width of the window |
height | initial height of the window |
display | Display to create the window on |
parent | parent Window |
style | can be any combination of WINDOW_TITLEBAR, WINDOW_RESIZABLE, WINDOW_CENTER, WINDOW_HIDDEN, WINDOW_CHILD, WINDOW_CLIENTCOORDS, WINDOW_FULLSCREEN, and WINDOW_ACCEPTFILES |
-- Get the display
local displays = GetDisplays()
local displayscale = displays[1]:GetScale()
-- Create a window
local style = WINDOW_TITLEBAR | WINDOW_CENTER
local window = CreateWindow("Example", 0, 0, 400 * displayscale, 300 * displayscale, displays[1], style)
-- Main loop
while not window:Closed() do
if window:KeyDown(KEY_ESCAPE) then
break
end
end