BMatjasic
Member
Hello guys,
Recently I've been working on a chat system in which I came to a small problem. I've created a script named draw_lines in which I've added the following code:
And this is the script in which I add line:
So the text currently appears like this:
How would I be able to make the first message appear at the bottom and the following messages up?
Thanks in advance!
PS: Great to be back on community again!
Recently I've been working on a chat system in which I came to a small problem. I've created a script named draw_lines in which I've added the following code:
Code:
var xx = argument0;
var yy = argument1;
var yyy = yy
for(var i=0; i < ds_list_size(lines); i++) {
var map = ds_list_find_value(lines, i);
var pname = ds_map_find_value(map, "pname");
var pcolor = ds_map_find_value(map, "pcolor");
var text = ds_map_find_value(map, "text");
var tcolor = ds_map_find_value(map, "tcolor");
draw_set_halign(fa_left);
draw_set_color(pcolor);
draw_set_font(fnt_name);
var str = string(pname) + " : ";
draw_text(xx, yy - 24*i,str);
draw_set_color(tcolor);
draw_set_font(fnt_text);
draw_text(xx + string_width(str)*1 , yy - 24*i, text);
}
Code:
var pname = argument0;
var pcolor = argument1;
var text = argument2;
var tcolor = argument3;
var map = ds_map_create();
ds_map_add(map, "pname", pname);
ds_map_add(map, "pcolor", pcolor);
ds_map_add(map, "text", text);
ds_map_add(map, "tcolor", tcolor);
ds_list_add(lines, map);
How would I be able to make the first message appear at the bottom and the following messages up?
Thanks in advance!
PS: Great to be back on community again!