Create image dynamically

Place to get help with not working mods / modding interface.
Post Reply
User avatar
apriori
Filter Inserter
Filter Inserter
Posts: 255
Joined: Thu Feb 18, 2016 8:13 pm
Contact:

Create image dynamically

Post by apriori »

Is there any way to create sprite for an entity prototype dynamically, combining from number of parts?
Any code or mods posted by me are WTFPL, unless otherwise copyrights are specified.

Hermios
Long Handed Inserter
Long Handed Inserter
Posts: 75
Joined: Sat Aug 13, 2016 2:57 pm
Contact:

Re: Create image dynamically

Post 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

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2058
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Create image dynamically

Post 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
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

User avatar
apriori
Filter Inserter
Filter Inserter
Posts: 255
Joined: Thu Feb 18, 2016 8:13 pm
Contact:

Re: Create image dynamically

Post 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)))
Any code or mods posted by me are WTFPL, unless otherwise copyrights are specified.

Post Reply

Return to “Modding help”

Who is online

Users browsing this forum: No registered users