Allow expression for changing image in Tiled Sprite/Panel Sprite action

A Tiled Sprite and Panel Sprite allows you to change the image with an action and pick the image from project or computer via drop-down selection. I’d like to be able to also use expressions to pick an image name based on variables for example.

I’m making a game where the player has color and pattern swatches they can pick from, and when clicked on one, a Tiled Sprite should change its image accordingly (from an image in the resources). I’m using a Tiled Sprite because I need to be able to resize the image and have the image repeat.

To manually add events to check what swatch they picked and then change the Tiled Sprite image accordingly will be tedious and add a lot of events to the event sheet. So if I had a “swatch” sprite or similar with an object variable, I could refer to the value in an expression after the swatch is clicked on.

The current state of Tiled Sprite’s “Image” action:

1 Like