Jump to content


MR-MG

Member Since 27 May 2010
Offline Last Active Jun 07 2011 05:41 PM

Topics I've Started

Problem with draw event

09 May 2011 - 04:49 PM

I made a variable called global.gun
and i create draw object
and when global.gun=0
i added this code
draw_sprite(sprite164,0,330,80)
and when global.gun=0
draw_sprite(sprite165,1,330,80)
but in game when i push the button object that change global.gun from 0 to 1
it show me this error !

___________________________________________
ERROR in
action number 1
of Draw Event
for object DRAW:

Error in code at line 95:
if global.gun[1]=0
^
at position 19: Cannot compare arguments.

Add sprite from computer problem

04 May 2011 - 09:32 AM

I used this code to make player add sprite from his computer to the game
In create event
global.photo = -1;
In left mouse event
var fname;
fname = get_open_filename("Pictures (*.bmp, *.gif, *.jpg, *.png)|*.bmp;*.gif;*.jpg;*.png", "");
if (fname != "") {
  global.photo = sprite_add(fname, 1, false, true, 0, 0);
}
In draw event
if not (global.photo = -1) {
  draw_sprite_stretched(global.photo, 0, 260, 77, 74, 94);

All that cods works perfect but the problem when i save my data to file
game_save("saves/sav.dat");
, well it saved but when i load that file again ("saves/sav.dat")
This massage shows up

___________________________________________
ERROR in
action number 1
of Draw Event
for object DRAW:

Trying to draw non-existing sprite.


But i am sure that all my cods is correct so any help ?!

How to delete and draw objects again

03 May 2011 - 11:50 AM

i have 4 objects for ex. (1,2,3 and4)
and i have variable menu.
what i need when variable menu =0 the 4 objects show up
and if not variable menu  =0 the 4 objects disabled .

How to change image from computer

13 April 2011 - 06:54 PM

How to make player choose image from his computer and draw it in the game room in 40x60 in this location (x=0,y=0).

about txt colors

31 March 2011 - 01:10 PM

i have this code

draw_text(130+view_xview[0],50+view_yview[0],"Gold  "+string(global.gold))
draw_text(130+view_xview[0],70+view_yview[0],"Score  "+string(global.score))

How to Draw gold with green color and score with red color  , i tried this code be for
draw_set_color(255);
to make score red but the problem is all my txt colored with red , and i cant stop that.