• 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!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

How to add an image to a sprite which contains one image

E

Erik131313

Guest
Hi,
I have a sprite which has an image. This image is load from a file .png.
After, I would add to this sprite a second image load from an other file .png.
How should I do it ?
Thanks
 

jonjons

Member
you will have to make a new data base
something like:

table.png

GML:
if ( id <= total_id )
{
    id += 1;
    sprite_index = id.sprite index;
    image_index = id.image index
}
 

Attachments

TsukaYuriko

☄️
Forum Staff
Moderator
That's the programmatical way to do it (although you should be careful about reserved variable names, as id is one of those)... so I'll cover the IDE way to do it.

If you have a sprite that already has sub images in it, and wish to load more sub images into it from another file, open the sprite's properties and click on the Edit Image button. Then, select the menu bar option Image -> Import Image(s). This will let you import another image into an already existing sprite as a new sub image.
 
Top