Slice/Sprite 9 in Game Objects

Sure did! I just wanted to add the use case I was trying to add a bit more information about how I was trying to use the GUI 9-slice, and why it didn’t work for me.

You’re mixing terms here. Sprite is one kind of Defold component. It’s a single image that will follow the game object as it moves in the game world. GUI is another kind of component. It is special since it usually renders in a separate step and it does not follow the game object it is attached to.

You can actually get an entire GUI to follow a game object if that is what you really want though.

The way I was trying to set it up was to be able to have a Game Object with a GUI component with the 9-slice texture applied to a Box node positioned at 0,0. Then I was going to try and create a factory that would instantiate multiple Game Objects (and therefore multiple GUIs) offset from each other to create a grid of the 9-slice box nodes.

As a test to see if I could move the GUI with the game object, I tried adding a single instance directly to the main collection and offset the position. It looked correct in the editor, but building it shifted the interface back to its original position.

1 Like

Obviously this is not how its supposed to be intended to be used anyway, hence why I came along to upvote the 9-slice feature for regular sprites.

3 Likes