Hi owners,


Do you like the games in AirGrafiti? Ever wanted to customize one of them to your liking? This article is for you!


In this article you will learn how to change the game's image thumb, how to select different tools like the spray can, color palette, stencils etc. and to choose from just about everything you want to be a part of the game.


So let’s begin by understanding how the games are built.


The default games location is: C:\Air Graffiti\Games, here you can see a screenshot from the default games folder. 



A game is represented by: 

  1. An image file.  
  2. XML settings file.


Once a game is selected, the image is loaded to AIR Graffiti as the game’s image, and the toolbar and features settings will change according to the .XML file. The name of the image file and the corresponding .xml file must be the same name.

Note: It is recommended to check out the out-of-box games before creating your own


Each game has an .xml file that is in charge of its settings. That's the file that we will change in order to customize the game.


Folders represent the games categories. You can nest folders in the following way:

Color Pages [Folder] → games_thumb.jpg [The thumbnail that represents the folder] → Easy [Folder] → Medium [Folder] → Hard [Folder] 


→ game_thumb.jpg [The thumbnail that represents the folder]

→ Rocket.jpg [the image file that will be loaded as the game’s photo] 

→ Rocket.xml [the game’s settings file] 



Understanding the .xml:

The .xml settings file allows you to have full control of the features and toolbar settings.
It can also allow you to load a specific cover per game, use predefined stencils and
stamps folders, set new size/blur/transparency values, whether the publish options
appear on the screen or not, and even hide and show the settings button.


Here is an example of  the Rocket’s game .xml file opened with “notepad++”:


Notice that the .xml file is made from item + name and a value.
For example in this line “<item name="drawingTime">180</item>”, the item is “drawing Time” and the value is “180”. That means that the user will have 180 seconds to draw.
Each line represents a different feature in the game.


This is an example of a very simple game that utilizes a foreground, a simple color palette and a “fill” tool to color the screen inside the outline. There are no additional tools/buttons loaded to the toolbar (like a spray tool selection, stencils, or the settings button) as they are defined as “false” in the .XML file (to enable them, you can change false to true).


This is how the game looks like - 


Notice that the only option is to choose a color.

Let's make a game of our own, to do that we will need 2 image files representing the same image: one in a .png format (with transparency) and the other in a .jpeg format.


1. Copy the existing .xml file and give it a different name: for example “frog”, and add a .jpg format picture to go with that .xml file (they have to have exactly the same name). In this example we will place the .jpg image in “C:\AirGraffiti\Games\Color Pages\Hard” but you can place the image wherever you see fit inside the Games folder.

2. Place the .png image in C:\AirGraffiti\Covers and make sure to give it the exact same name as the .jpg image.


3. Now, to edit the .xml file we copied:


This is how it looks after the modifications I made:


Notice that I have changed just 4 lines 


  1. “enablePublishMenuBtn” was false →  true - this will allow the user to send email/text
  2. The path from which the .png image is drawn from
  3. “enableSpraySelection” was false → true - this will enable the spray tool
  4. “enableEraseSelection” was false → true - this will enable the eraser


Note: the simplest way to add a game is to take an existing settings .xml file, copy it, change its name and add a corresponding .jpg file and .png file. This new game will behave exactly as the original game, just with a different photo.

The More advanced & Flexible way is to understand the settings .xml file, and developing new concepts that you can utilize to further set yourself apart from the competition.


 


That’s it! you are a game creator!


Have fun!