- Статус
- Оффлайн
- Регистрация
- 6 Фев 2018
- Сообщения
- 1,559
- Реакции
- 588
Заебали...
Что где куда объяснять не буду, кто захочет сам поймёт.
/upd:
^ aspect ratio lua.
Что где куда объяснять не буду, кто захочет сам поймёт.
/upd:
Код:
--aspect ratio start
local Checkbox = gui.add_checkbox
local Slider = gui.add_slider
local bEnableRatioChanger = Checkbox("Aspect Ratio", "lua>tab a")
local flHeightRatio = Slider("Height", "lua>tab a", 1, 20, 1)
local flWidthRatio = Slider("Width", "lua>tab a", 1, 20, 1)
local function AR()
if bEnableRatioChanger:get_bool() then
gui.set_visible("lua>tab a>Height", true)
gui.set_visible("lua>tab a>Width", true)
else
gui.set_visible("lua>tab a>Height", false)
gui.set_visible("lua>tab a>Width", false)
end
local multiple = flWidthRatio:get_float() / flHeightRatio:get_float()
local r_aspectratio = cvar.r_aspectratio
local screen_width, screen_height = render.get_screen_size()
local value = (screen_height / screen_width) * multiple
local value1 = 0
if multiple == 1 then
value = 0
end
r_aspectratio:set_float(bEnableRatioChanger:get_bool() and value or value1)
end
--aspect ratio end
function on_paint()
AR()
end
Вложения
Последнее редактирование: