/
d.vision
/
division_engine_cpp
Обзор
Документация
Войти
/
d.vision
/
division_engine_cpp
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
resources/scripts/border_radius.lua
53 строки
1 KB
den163
Added simple lua library for drawing
05 июн 2024, 13:49
05 июн 2024, 13:49
5d00c40
Код
Авторство
О чём код?
local ffi = require "ffi" ffi.cdef [[ typedef struct { float top_right, bottom_right, top_left, bottom_left; } border_radius_t; ]] local border_radius ---@class border_radius_mt local mt = { ---@param tr number ---@param br number ---@param tl number ---@param bl number ---@return border_radius tr_br_tl_bl = function(tr, br, tl, bl) return border_radius(tr, br, tl, bl) end, ---@param all number, ---@return border_radius all = function(all) return border_radius(all, all, all, all) end, ---@param top number ---@return border_radius top = function(top) return border_radius(top, 0, top, 0) end, ---@param right number ---@return border_radius right = function(right) return border_radius(right, right, 0, 0) end, ---@param bottom number ---@return border_radius bottom = function(bottom) return border_radius(0, bottom, 0, bottom) end, ---@param left number ---@return border_radius left = function(left) return border_radius(0, 0, left, left) end, } mt.__index = mt ---@class border_radius : border_radius_mt ---@field top_right number ---@field bottom_right number ---@field top_left number ---@field bottom_left number border_radius = ffi.metatype("border_radius_t", mt) return border_radius