Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
This video taught me how to do this and it worked.
Edit:
You might not even need to include working_directory perhaps something more like /images/dragon.png read http://docs.yoyogames.com/source/dadiospice/002_reference/game%20assets/sprites/sprite_add.html
A-am I the only one that reads the docs?
Quick question though. When I add the included file into the editor, does that simply contain the file name? because I am wanting the sprites in the card sandbox to be user defined. Does this mean that if I were to replace the image but retain the name that it would still work and use the new image provided?
Yes it would, so long as the image is the same size it wont conflict with the game in any way. I'd read into user customization and perhaps making your game opensource so people could add their own cards with their own effects (like Relic Hunters Zero, you can grab its source code for GMS on its forums.
Hmm... I just tried replacing the image in the folder with another image of the same name, same size, etc... and it is still using the originally provided png file. Am I missing something or is it simply not possible at this point?
Maybe its you that belongs in GMC, where you can call others ♥♥♥♥♥♥♥ for doing something wrong.
Hmm, let me make a quick program and Ill message it to you, showing that the image can be replaced, or Ill record on fraps and link you to it.
I would greatly appreciate that. Thank you!
02: Can you simply write out a detailed explanation of how to do it instead of a video?
03: No, I am not using a draw event. All of this has been done in a create event.
CREATE EVENT:
sprite=sprite_add(...);
if(!sprite) //you should include an error check.
{
show_message("problem with sprite Dragons.png error 1 is missing!");
}
DRAW EVENT:
if(sprite)
{
draw_sprite(sprite,image_index,x,y);
}
global.sprite = sprite_add("dragons.png", 0, 0, 0, 0, 0); //create a var, it reads to add the file dragons.png to memory at frame 0 (first frame) with no additional effects
if(!sprite) //check for sprite if(!something) is if something doesnt exist, the ! is sorta like no/false
{
show_message("Error 1 Sprite dragons.png MISSING!!!"); //display message error 1
}
DRAW EVENT
if(sprite) //draw sprite if it exists, notice how there is no !
{
draw_sprite(global.sprite,0,0,0); //draw at 0,0 of where object is placed in room (top left corner of it)
}