Files
SE_Exam/lua/annotation.lua
2025-01-22 00:16:29 +01:00

236 lines
6.9 KiB
Lua

---@meta
--- This file provides type annotations for Lua scripts interacting with C++ via SOL2.
--- The Color class exposed from C++
--- @class Color
--- @field r number # The red component of the color.
--- @field g number # The green component of the color.
--- @field b number # The blue component of the color.
Color = {}
--- constructor
--- @param r number # The red component of the color.
--- @param g number # The green component of the color.
--- @param b number # The blue component of the color.
--- @return Color
function Color.new(r, g, b) end
--- The Bitmap class exposed from C++
--- @class Bitmap
--- @field filename string # The filename of the bitmap.
Bitmap = {}
--- constructor
--- @param filename string # The filename of the bitmap.
--- @return Bitmap
function Bitmap.new(filename) end
--- Sets the transparency color
--- @param color Color # The color to set as transparent.
--- @return nil
function Bitmap:SetTransparencyColor(color) end
--- Sets the Opacity
--- @param opacity number # The opacity to set.
--- @return nil
function Bitmap:SetOpacity(opacity) end
--- Gets if the bitmap exists
--- @return boolean # True if the bitmap exists, false otherwise.
function Bitmap:Exists() end
--- Gets the width of the bitmap
--- @return number # The width of the bitmap.
function Bitmap:GetWidth() end
--- Gets the height of the bitmap
--- @return number # The height of the bitmap.
function Bitmap:GetHeight() end
--- The Textbox class exposed from C++
--- @class Textbox
--- @field text string # The text of the textbox.
Textbox = {}
--- constructor
--- @param text string # The text of the textbox.
--- @return Textbox
function Textbox.new(text) end
--- Set the bounds of the textbox
--- @param x number # The x coordinate of the textbox.
--- @param y number # The y coordinate of the textbox.
--- @param width number # The width of the textbox.
--- @param height number # The height of the textbox.
--- @return nil
function Textbox:SetBounds(x, y, width, height) end
--- Set the text of the textbox
--- @param text string # The text of the textbox.
--- @return nil
function Textbox:SetText(text) end
--- Sets the background color of the textbox
--- @param color Color # The color to set as the background.
--- @return nil
function Textbox:SetBackgroundColor(color) end
--- Sets the foreground color of the textbox
--- @param color Color # The color to set as the foreground.
--- @return nil
function Textbox:SetForegroundColor(color) end
--- Sets the textbox to be enabled
--- @param enabled boolean # True if the textbox is enabled, false otherwise.
--- @return nil
function Textbox:SetEnabled(enabled) end
--- Shows the textbox
--- @return nil
function Textbox:Show() end
--- Hides the textbox
--- @return nil
function Textbox:Hide() end
--- Gets the text in the textbox
--- @return string # The text in the textbox.
function Textbox:GetText() end
--- The Game engine class exposed from C++
--- @class Engine
GameEngine = {}
--- @type
GameEngine = GameEngine
---Sets the title of the window.
---@param title string # The new title.
---@return nil
function GameEngine:setTitle(title) end
--- Sets the width of the window.
--- @param width number # The new width.
--- @return nil
function GameEngine:setWidth(width) end
--- Gets the window width.
--- @return number # The width of the window.
function GameEngine:getWidth() end
--- Gets the window height.
--- @return number # The height of the window.
function GameEngine:getHeight() end
--- Sets the height of the window.
--- @param height number # The new height.
--- @return nil
function GameEngine:setHeight(height) end
--- Sets the frame rate of the window.
--- @param frameRate number # The new frame rate.
--- @return nil
function GameEngine:setFrameRate(frameRate) end
--- Sets the drawing color
--- @param color Color # The new color.
--- @return nil
function GameEngine:setColor(color) end
--- Fills the screen
--- @param color Color # The color to fill the screen with.
--- @return nil
function GameEngine:fillScreen(color) end
--- message box
--- @param message string # The message to display.
--- @return nil
function GameEngine:messageBox(message) end
--- Draw a bitmap
--- @param bitmap Bitmap # The bitmap to draw.
--- @param x number # The x coordinate of the bitmap.
--- @param y number # The y coordinate of the bitmap.
function GameEngine:drawBitmap(bitmap, x, y) end
--- Draws a rectangle
--- @param x number # The x coordinate of the rectangle.
--- @param y number # The y coordinate of the rectangle.
--- @param width number # The width of the rectangle.
--- @param height number # The height of the rectangle.
--- @return nil
function GameEngine:drawRect(x, y, width, height) end
--- fills a rectangle
--- @param x number # The x coordinate of the rectangle.
--- @param y number # The y coordinate of the rectangle.
--- @param width number # The width of the rectangle.
--- @param height number # The height of the rectangle.
--- @return nil
function GameEngine:fillRect(x, y, width, height) end
--- draws an oval
--- @param x number # The x coordinate of the oval.
--- @param y number # The y coordinate of the oval.
--- @param width number # The width of the oval.
--- @param height number # The height of the oval.
function GameEngine:drawOval(x, y, width, height) end
--- fills an oval
--- @param x number # The x coordinate of the oval.
--- @param y number # The y coordinate of the oval.
--- @param width number # The width of the oval.
--- @param height number # The height of the oval.
function GameEngine:fillOval(x, y, width, height) end
--- draws text
--- @param text string # The text to draw.
--- @param x number # The x coordinate of the text.
--- @param y number # The y coordinate of the text.
--- @return nil
function GameEngine:drawText(text, x, y,) end
--- Checks if a key is pressed
--- @param key string # The key to check.
--- @return boolean # True if the key is pressed, false otherwise.
function GameEngine:isKeyDown(key) end
--- Gets the mouse Position X
--- @return number # The x coordinate of the mouse.
function GameEngine:getMouseX() end
--- Gets the mouse Position Y
--- @return number # The y coordinate of the mouse.
function GameEngine:getMouseY() end
--- Get if the left mouse button isKeyDown
--- @return boolean # True if the left mouse button is pressed, false otherwise.
function GameEngine:isMouseLeftDown() end;
--- Get if the right mouse button isKeyDown
--- @return boolean # True if the right mouse button is pressed, false otherwise.
function GameEngine:isMouseRightDown() end;
--- Preform a Get Request
--- @param url string # The url to get.
--- @return string # The response from the server.
function GameEngine:getRequest(url) end
--- Preform a Post Request
--- @param url string # The url to post.
--- @param data string # The data to post.
function GameEngine:postRequest(url, data) end
--- Opens a dialog to enter a string
--- @return string # The string entered by the user.
function GameEngine:GetString() end