• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML [SOLVED]Problem drawing sprites in the gui layer.

A

azuarf

Guest
I drew a gui button which is drawn just fine. But when i try to draw another sprite in the gui it draws it in a strange way. I added the spr_gui_gold later and thats the sprite thats bugging out. Heres the code:

Code:
draw_sprite(spr_gui_gold1,0,1700,0); // This is the sprite thats not being drawn properly.
draw_set_halign(fa_right);
draw_text_transformed(1890,0,global.gold_pl,3,3,0);
draw_set_halign(fa_left);

//Everything bellow this line was already there and it works fine
draw_sprite(spr_store_butt,0,1800,940);
if point_in_rectangle(window_mouse_get_x(),window_mouse_get_y(),1800,940, 1896,1004)
{
hover = 1;
}
else
{
hover = 0;
}
if (mouse_check_button_pressed(mb_left) && hover = 1)
{
global.mouse_state = 0;
view_visible[0] = false;
view_visible[3] = true;
instance_create(obj_view_menu.x,obj_view_menu.y,obj_store_pt);

}
why2.png
 

CMAllen

Member
Okay, the draw call is done properly, so something has happened to the correct sprite at run-time. Now you need to figure out what sprite and sub-image it is actually drawing. After that, you should go back through your code and figure out where else your code references either sprite.
 
A

azuarf

Guest
Okay, the draw call is done properly, so something has happened to the correct sprite at run-time. Now you need to figure out what sprite and sub-image it is actually drawing. After that, you should go back through your code and figure out where else your code references either sprite.
well i could not find the sprite that was being drawn. nor could i find any reason or code that could cause it. I opend up a few days old backup i had and added the gold sprite. It works as it should in that backaup save.
is this fairly common ouccurance? dose gamemaker break on everyone like this?
 

CMAllen

Member
I haven't had sprites corrupt like that before, but I have had sound files inexplicable break and stop working properly.
 
A

azuarf

Guest
I haven't had sprites corrupt like that before, but I have had sound files inexplicable break and stop working properly.
It fixed itself.... I restarted my pc after ages. now the sprite is being loaded correctly. :D
 
H

HItch

Guest
I'm having the same problem with my gui sprites randomly scaling down. Maybe I'll try restarting my comp.
 
A

azuarf

Guest
I'm having the same problem with my gui sprites randomly scaling down. Maybe I'll try restarting my comp.
in my case, the pc was constantly on for quiet a few days. i am guessing that it makes gamemaker unstable. also had played withcer 3 for a few hours and my torrent is also constantly downloading and seading. i have evan seen torrent misbehave wiredly if my pc has not had rest in a long while. like downloaded images showing some other image form some other torrent. but once the torrent is complete and checked its all as it should be. this might not be a gamemaker problem but a windows problem.
i also do not know much about windows or advanced programing. but just writing my experience. might help others not starting their project from scratch again cause their pc needs a restart.
 
Top