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

How to use subimage in room properties?

N

nicei7

Guest
I have in properties room in objects, object1. When click and move it to room this object is with subimage -1.
In my sprite I have 20 subimages.
How to click and create object 1 in room properties and some object1 to have subimage 1, other subimage 2. I have position or rotation or size for object 1. But can't change subimage -1.

I don't want to create obj1-obj20 with sprite1 -20 to create objects with different sprite.
 
Last edited by a moderator:

jo-thijs

Member
Right click on your instance, click on "Creation Code...", then write this:
Code:
image_index = // replace this comment with the subimage number
This code will only be executed after the create event though.
 

FrostyCat

Redemption Seeker
When you add an instance of the object to the room, right-click on it, select Creation Code and set its image_index there.
 
J

jackhigh24

Guest
when you place an object in the room editor its then its own instance so you can then right click on it and set anything you want, it will only effect that exact one
LOL double ninja'd
 
N

nicei7

Guest
I know image_index, but want to change image index to object1 in Room properties. When move object1 in room.
 

jo-thijs

Member
There's no box in the editor to change image_index, but there is a way to make every instance execute some specific code when they're created.
Using that, you can still give every instance a different image_index in the room editor, you'll just have to right click on the instances and choose "Creation Code...".
 
N

nicei7

Guest
I want to view in Room Properties how look image of object 1 with subimage. Want to use Room Properties like editor. Maybe for different subimage must use different object with different sprite. Is this ok, to use 50-100 sprites in 50-100 images and no in one sprite with subimage ?
 
Last edited by a moderator:

TheouAegis

Member
As long as you delete those sprites from your final project, sure. You're going to be wasting a ton of memory just for a superficial attribute. You could just as easily use tiles and have an object replace all the tiles with the objects you want to see in the room editor.
 
Top