- [FIX] draw.text() també soporta que li pases un numero pa escriure-lo

This commit is contained in:
2025-06-18 19:52:24 +02:00
parent e1d5eb051c
commit 9cd991cb44
2 changed files with 13 additions and 2 deletions

View File

@@ -20,7 +20,11 @@ void main()
float x = sign(pix_coord.x)*floor(abs(pix_coord.x)+0.5);
float column = mod(x,4.0);
vec4 color = texture2D(Texture, tex_coord);
color = color + vec4(0.5, 0.5, 0.5, 0.0) * (1.0-tex_coord.t);
float xfade = abs((tex_coord.s * 2.0) - 1.0);
xfade = xfade * xfade * xfade * xfade * xfade;
float yfade = abs((tex_coord.t * 2.0) - 1.0);
yfade = yfade * yfade * yfade * yfade * yfade;
color = color + vec4(0.7, 0.7, 0.7, 0.0) * (1.0-tex_coord.t) * (1.0-xfade) * (1.0-yfade);
vec4 newcolor;
if (column == 0.0) {
newcolor = color * vec4(1.0, 0.4, 0.6, 1.0);

View File

@@ -268,6 +268,13 @@ function draw.surfrot(sx, sy, sw, sh, x, y, a) end
---Draw text to (x,y) using the specified color
function draw.text(text, x, y, color) end
---@param text number
---@param x number
---@param y number
---@param color number
---Draw text to (x,y) using the specified color
function draw.text(text, x, y, color) end
---@class shader
shader = {}