Page 1 of 1

Create image dynamically

Posted: Fri May 19, 2017 11:47 pm
by apriori
Is there any way to create sprite for an entity prototype dynamically, combining from number of parts?

Re: Create image dynamically

Posted: Sat May 20, 2017 8:11 pm
by Hermios
I assume that this is not literally possible, as images are loaded at start.
But you may play with existing entities like train-stop, rail signals etc. that contain animation and whose images are actually divided in several parts
Replacing animations could help you create various images
Maybe if you are more precise, we could give a better answer.
Hermios

Re: Create image dynamically

Posted: Sat May 20, 2017 8:34 pm
by Ranakastrasz
I think so. Look at the base-game script for how Barreling icons are created. I am pretty sure you can copy that and use it for entities as well.

data/base/data-updates

Re: Create image dynamically

Posted: Sun May 21, 2017 3:18 pm
by apriori
Ranakastrasz wrote:I think so. Look at the base-game script for how Barreling icons are created. I am pretty sure you can copy that and use it for entities as well.

data/base/data-updates
Thanks for the reply. I already can create combined icons (as in exampled file), but I want to create combined entity sprites on game loading. My entity is container type and it only supports "picture" field - no "layers", no "pictures", no animation or so. That's why I ask. Maybe it supports some tricky property I don't know. But I... don't know)))