Page 1 of 1

Dynamic sprite generation

Posted: Fri Aug 25, 2017 2:50 pm
by Atria
Is it possible to generate sprites using script on game load and still use it in prototypes?

I'm pretty sure it's not possible, just tought of asking before completely rejecting this idea.

Re: Dynamic sprite generation

Posted: Fri Aug 25, 2017 9:38 pm
by Rseding91
You can layer sprites (which is what the base game does to generate the barrel icons) but that's about it.

Re: Dynamic sprite generation

Posted: Sat Aug 26, 2017 4:19 am
by Atria
So it could be possible to layer a lot of small sprites next to each other to create ilusion of one big sprite?

Is it possible to do he same with picture property of entity like this?

Code: Select all

picture = {
    {filename, x, y, width, height, shift, ...},
    {sprite two},
    {sprite three},
    {sprite four},
    ....
},

Re: Dynamic sprite generation

Posted: Sat Aug 26, 2017 8:13 am
by darkfrei
See car animation: layers for layers, stripes for multiple files spritesheet.

Code: Select all

    animation =
    {
      layers =
      {
        {
          stripes =
          {
            {
             filename = "__base__/graphics/entity/car/car-1.png",
             width_in_frames = 2,
             height_in_frames = 22,
            },
            {
             filename = "__base__/graphics/entity/car/car-2.png",
             width_in_frames = 2,
             height_in_frames = 22,
            },
By turrets you can find same layers too.

Re: Dynamic sprite generation

Posted: Sat Aug 26, 2017 9:18 am
by Atria
darkfrei wrote:See car animation: layers for layers, stripes for multiple files spritesheet.

Code: Select all

    animation =
    {
      layers =
      {
        {
          stripes =
          {
            {
             filename = "__base__/graphics/entity/car/car-1.png",
             width_in_frames = 2,
             height_in_frames = 22,
            },
            {
             filename = "__base__/graphics/entity/car/car-2.png",
             width_in_frames = 2,
             height_in_frames = 22,
            },
By turrets you can find same layers too.
Thank you, hopefully it will work with chests.