Вопрос Fatality render texture png

Начинающий
Статус
Оффлайн
Регистрация
16 Окт 2021
Сообщения
51
Реакции[?]
10
Поинты[?]
8K
code_language.lua:
local CheckboxItem = gui.add_checkbox("enable picture","Lua>tab a")
local screenx,screeny = render.get_screen_size()
local photo = render.create_texture("fatality/image.png")
local n = gui.add_slider("Head Ball X","lua>tab a",0,screenx,1)
local m = gui.add_slider("Head Ball Y","lua>tab a",0,screeny,1)
local s = gui.add_slider("Head Ball Size","lua>tab a",100,300,10)
local photow,photoh = render.get_texture_size(photo)
local ratio = photow / photoh
function on_paint()
    if not CheckboxItem:get_bool() then
        return
    end
    local size = s:get_int()
    local x = n:get_int()
    local y = m:get_int()
    render.push_texture(photo)
    render.rect_filled(x, y, x + size, y + size, render.color(255, 255,255))
    render.pop_texture()
end
 
Эксперт
Статус
Оффлайн
Регистрация
10 Фев 2021
Сообщения
1,739
Реакции[?]
559
Поинты[?]
2K
code_language.lua:
local CheckboxItem = gui.add_checkbox("enable picture","Lua>tab a")
local screenx,screeny = render.get_screen_size()
local photo = render.create_texture("fatality/image.png")
local n = gui.add_slider("Head Ball X","lua>tab a",0,screenx,1)
local m = gui.add_slider("Head Ball Y","lua>tab a",0,screeny,1)
local s = gui.add_slider("Head Ball Size","lua>tab a",100,300,10)
local photow,photoh = render.get_texture_size(photo)
local ratio = photow / photoh
function on_paint()
    if not CheckboxItem:get_bool() then
        return
    end
    local size = s:get_int()
    local x = n:get_int()
    local y = m:get_int()
    render.push_texture(photo)
    render.rect_filled(x, y, x + size, y + size, render.color(255, 255,255))
    render.pop_texture()
end
Братан спасибо
 
Сверху Снизу