• 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.

GMS 2.3+ How to add an image to a sprite which contains one image

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