ImageBuilder - SiD3W4y/VillageSelector GitHub Wiki

Introduction

The ImageBuilder object is an object that turns village json data into an image , it is using the http://clashofclansbuilder.com/ textures and appearance.

! ImageBuilder loads all needed textures when it is created , try to use only one or so by project

How to use it :

Let's start by creating our object : ImageBuilder builder = new ImageBuilder() It will load all textures in memory

Next we will need to give it data to work on , you need to pass a BuildingList object through setBuildings() method ,to give it all of our village buildings simply do this : builder.setBuildings(village.buildings());

Once it is done , create the image using process method : builder.process();

To get the result , you've got two options :

  • Write the image to a file using : builder.imageToFile(String path);
  • Or get the Graphics object to draw the result on a window using : builder.getImage()