Ziberteck
Member
So I've been noticing that there is an issue with depth in game maker html5 edition what doesn't exist in the windows version. To reduce lag, as one should, i have a script that limits the objects that are active on the screen.
However in the html version when objects are loaded again when approached their depth is all over the place.
I can fix it if I add this code to every step event of the objects that are activated, but that is a rather taxing way work around at this point(with as many various objects i have that are effected). The obvious solution seemed to be to run this code using an with(all) statement but that seems to break their functionality(which i can't even begin to figure out why that is). This project wasn't initially going to have an html5 version, so it wasn't optimized for that platform, but i'm at a loss as to how to fix this atm. Any and all help would be appreciated.
Code:
// code ran through the step event of a persistent controller object.
//activate instances
instance_activate_all();
//de-activate anything outside of the view
instance_deactivate_region(view_xview[0]-64,view_yview[0]-64,view_wview[0]+64,view_hview[0]+64,false,true);
//keep activated
instance_activate_object(obj_wall);
instance_activate_object(obj_wall_threw);
//instance_deactivate_region(view_xview[0]-384,view_yview[0]-384,view_wview[0]+384,view_hview[0]+384,false,true);
instance_activate_object(obj_player);
Code:
//work around code.
var temp = depth;
depth = 1;
depth = round(temp);