EdgeOfChaos
E
EdgeOfChaos
So I'm making a battle system, and displaying a floating text message after each user attacks. This is my function:
When I play the game, it displays and remains there for 1.5 seconds. No problem there. But eventually (and it seems there is no real pattern to it), but text starts to glitch. It still displays, but when it does, it overwrites/deletes the last created floating text, so that there can only be one present anymore. I'm using a local text tag, so I don't understand what could possibly be causing this.. Once this happens, it remains for the rest of the game like this.
If it makes any difference, I don't call that function directly, but call these ones instead:
Anyone know what's going on?
JASS:
private function text takes string s, unit u, integer r, integer g, integer b, integer z returns nothing
local texttag display = CreateTextTag()
local real textHeight = 9 * 0.023 / 10
local real vel = 64 * 0.071 / 128
local real xvel = vel * Cos(90 * bj_DEGTORAD)
local real yvel = vel * Sin(90 * bj_DEGTORAD)
call SetTextTagText(display, s , textHeight)
call SetTextTagPosUnit(display, u, z)
call SetTextTagColor(display, r, g, b, 255)
call SetTextTagVelocity(display, xvel, yvel)
call SetTextTagPermanent( display, false )
call SetTextTagLifespan( display, 1.50 )
endfunction
When I play the game, it displays and remains there for 1.5 seconds. No problem there. But eventually (and it seems there is no real pattern to it), but text starts to glitch. It still displays, but when it does, it overwrites/deletes the last created floating text, so that there can only be one present anymore. I'm using a local text tag, so I don't understand what could possibly be causing this.. Once this happens, it remains for the rest of the game like this.
If it makes any difference, I don't call that function directly, but call these ones instead:
JASS:
function redText takes string s, unit u, integer z returns nothing
call text(s,u,255,85,85,z)
endfunction
function blueText takes string s, unit u, integer z returns nothing
call text(s,u,85,85,255,z)
endfunction
function greenText takes string s, unit u, integer z returns nothing
call text(s,u,85,255,85,z)
endfunction
function plainText takes string s, unit u, integer z returns nothing
call text(s,u,255,255,255,z)
endfunction
function darkText takes string s, unit u, integer z returns nothing
call text(s,u,127,127,127,z)
endfunction
Anyone know what's going on?