S
shadow7692
Guest
I have the code below in the Draw GUI event, where
How would I go about changing this so that it doesn't? I would still need to draw everything based on an array of some sort.
Target
is an instance id, and has a instance variable of Inventory
which is a ds_list. When this is executed I get HUGE fps drops, and I'm fairly certain it's because iterating through the whole ds_list every draw step is very memory consuming.How would I go about changing this so that it doesn't? I would still need to draw everything based on an array of some sort.
Code:
if (!ds_list_empty(Target.Inventory)) {
for (var i = 0; i < ds_list_size(Target.Inventory); i++) {
var Item = Target.Inventory[| i]
if (Item[2] == false) { // not equipped
draw_set_halign(fa_right);
draw_text_transformed(x-410+i*88, y+65, Item[1], 1.7, 1.6, 0); // show amount of the item
};
};
};