math.lerp = function(a, b, percentage)
return a + (b - a) * percentage
end
color_t.fade_color = function(f, s, a)
local r = math.lerp(f.red * 255, s.red * 255, a)
local g = math.lerp(f.green * 255, s.green * 255, a)
local b = math.lerp(f.blue * 255, s.blue * 255, a)
local a = math.lerp(f.alpha * 255, s.alpha * 255, a)
return color_t.new(r, g, b, a)
end
function DrawEnchantedText(speed, text, font, pos, size, color, glow_color)
local chars_x = 0
local len = #text - 1
for i = 1, len + 1 do
local text_sub = string.sub(text, i, i)
local text_size = renderer.get_text_size(font, size, text_sub .. "")
local color_glowing = color_t.fade_color(glow_color, color, math.abs(math.sin((globalvars.get_real_time() - (i * 0.02)) * 1.5)))
renderer.text(text_sub .. "", font, vec2_t.new(pos.x + chars_x, pos.y), size, color_glowing)
chars_x = chars_x + text_size.x
end
end
local smallest_pixel_7 = renderer.setup_font("nix/Fonts/smallest_pixel-7.ttf", 20, 0)
local screensize = engine.get_screen_size()
client.register_callback("paint", function()
DrawEnchantedText(2, "1 | xavai xyu", smallest_pixel_7, vec2_t.new(screensize.x / 2 - 55, screensize.y / 2 + 50), 20, color_t.new(0, 0, 0, 255), color_t.new(255, 140, 184, 255), color_t.new(255, 140, 184, 255), color_t.new(255, 140, 184, 255), color_t.new(255, 140, 184, 255))
end)