D
Dengar
Guest
this is my code that's causing a small memory leak but I don't understand how, or how to fix it. I need advice.
the code simply draws text on the screen using # linebreaks, also draws a black rectangle the same size behind text, it uses the number of # to determin height of chatbox.
example is p_string="line3#line2#line1#";
is string_count() causing the trouble somehow?
the code simply draws text on the screen using # linebreaks, also draws a black rectangle the same size behind text, it uses the number of # to determin height of chatbox.
example is p_string="line3#line2#line1#";
is string_count() causing the trouble somehow?
Code:
//draw event
if !p_string = ""
{
var stat = string_count("#",p_string) * 16;
var stat2 = string_count("#",p_string) * 15;
draw_set_colour(c_black);
draw_rectangle(100,150-stat,200,150,0);
draw_set_colour(c_white);
draw_text(100,150-stat2,p_string);
}