mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
74 lines
1.2 KiB
Lua
74 lines
1.2 KiB
Lua
local core = {}
|
|
|
|
local events = {}
|
|
|
|
---@class monitor_touch
|
|
---@field monitor string
|
|
---@field x integer
|
|
---@field y integer
|
|
|
|
---@param monitor string
|
|
---@param x integer
|
|
---@param y integer
|
|
---@return monitor_touch
|
|
function events.touch(monitor, x, y)
|
|
return {
|
|
monitor = monitor,
|
|
x = x,
|
|
y = y
|
|
}
|
|
end
|
|
|
|
core.events = events
|
|
|
|
local graphics = {}
|
|
|
|
---@alias TEXT_ALIGN integer
|
|
graphics.TEXT_ALIGN = {
|
|
LEFT = 1,
|
|
CENTER = 2,
|
|
RIGHT = 3
|
|
}
|
|
|
|
---@class graphics_frame
|
|
---@field x integer
|
|
---@field y integer
|
|
---@field w integer
|
|
---@field h integer
|
|
|
|
---@param x integer
|
|
---@param y integer
|
|
---@param w integer
|
|
---@param h integer
|
|
---@return graphics_frame
|
|
function graphics.gframe(x, y, w, h)
|
|
return {
|
|
x = x,
|
|
y = y,
|
|
w = w,
|
|
h = h
|
|
}
|
|
end
|
|
|
|
---@class cpair
|
|
---@field fgd color
|
|
---@field bkg color
|
|
---@field blit_fgd string
|
|
---@field blit_bkg string
|
|
|
|
---@param foreground color
|
|
---@param background color
|
|
---@return cpair
|
|
function graphics.cpair(foreground, background)
|
|
return {
|
|
fgd = foreground,
|
|
bkg = background,
|
|
blit_fgd = colors.toBlit(foreground),
|
|
blit_bkg = colors.toBlit(background)
|
|
}
|
|
end
|
|
|
|
core.graphics = graphics
|
|
|
|
return core
|