Sprite replacing problems

Posted by Fri on Feb. 28, 2008, 7:38 p.m.

Hi again 64digits.. wow it really has been a long time since i visited here. My reasons are because of life and just generally being the busy person i am. Anyway I might try and be more active from now on.

Anyway to the point of this blog: I have recently began work on a GM project where part of the game is that th user draws on screen. Anyone ever played draw play? Well it's like that. So the user draws onto a surface and when they finish that bit of the drawing (Global Left Release) it is saved using the surface_save() function. then it is also loaded back into the game. Now the only problem i seem to be having with this is when i try to load the sprite into the game. The sprite is supposed to be replacing the sprite "spr_area" but this does not seem to be happening. This is the code which i believe to be causing the problem:

Global Left Release

surface_save(0,"canvas");

sprite_replace(spr_area,spr_face,0,false,false,false,true,0,0);

I can't find what i'm doing wrong so i'm hoping somebody can point me in the right direction, thanks ;)

Comments

s 16 years, 9 months ago

Praps it is the surface ID?

Fri 16 years, 9 months ago

Thats the only surface used in the game therefore it's ID is 0

Treebasher 16 years, 9 months ago

Maybe when you make the surface, store it in a variable, then instead of using 0, use the variable?

ludamad 16 years, 9 months ago

You can never tell with data structure IDs, really.

marbs 16 years, 9 months ago

spr_face should be a file name, not sprite index =)

Fri 16 years, 9 months ago

Ah, i was loading a file called spr_face but i just figured out that i had to load spr_face.bmp