Author Topic: How to understand certain source files.  (Read 159 times)

0 Members and 1 Guest are viewing this topic.

Offline hadrian900

  • Laborer
  • **
  • Posts: 10
How to understand certain source files.
« on: April 08, 2018, 11:20:33 AM »
As i was browsing source files to understand how the game is compiled, i find a lot of things never covered in the mod guide by the developer.

I have no developing, nor large programming knowledge.

Right now i'm trying to understand this particular file: "AppiarySpriteSheet.rsc"

I know that ...
Code: [Select]
Sprite _sprites
{ String _name = "BuildApiary"; String _source = "UI/Sprite/BuildApiary.png"; }
{ String _name = "AphiaryWork"; String _source = "UI/Sprite/ApiaryWork.png"; }

{ String _name = "HoneySmall"; String _source = "UI/Sprite/HoneySmall.png"; }
{ String _name = "Honey"; String _source = "UI/Sprite/Honey.png"; }

{ String _name = "ProfessionBeekeeper"; String _source = "UI/Sprite/Beekeeper.png"; }
...calls images which are supposed to show up in Interface accordingly.

The part i do not understand is
Code: [Select]
SpriteSheet resource
String _materialName = "ApiarySpriteSheetMaterial.rsc";
String _imageName = "Build/ApiarySpriteSheet.png";
int _imageWidth = 128;
int _imageHeight = 128;
bool _padForFiltering = true;

I have looked into sprite sheet of unmodded game, where it leads and what file it reffers to, what makes me believe this part is supposed to compile sprites in one image.

So what does this do exactly?

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 8690
  • Country: ca
Re: How to understand certain source files.
« Reply #1 on: April 08, 2018, 12:37:13 PM »
it creates a transparent .png with all the icons on it.
compile it, and then go in the /build folder of your mod(or in this case, the /build folder of example/apiary/ folder), you will see a bigger .png (defined by the width/hight) with all the icons draw on it. thats what the game use

i am gonna put here in attachment , an example of such file created with all the UI/Sprite/icons.png pasted to it
this code you dont understand serves to create this kind of spritesheet.png
> > > Support Mods Creation developments with Paypal Donations < < <
Click here to PayPal Donate.