--- a/Hats.wiki Sun Jan 17 12:50:44 2016 +0000
+++ b/Hats.wiki Sun Jan 17 12:51:30 2016 +0000
@@ -1,10 +1,11 @@
#summary Explanation of hats, how Hedgewars draws them and how one can create them
-= Introduction =
+= Hats =
+== Introduction ==
In Hedgewars, every hedgehog can optionally wear its own hat as decoration. They can be selected on a per-hog basis in the team editor.
-= Types of hats =
+== Types of hats ==
There are two types of hats: non-team hats and team hats.
Non-team hats have a fixed coloring which does not depend on the team color.
Team hats are hats which will be colored accordingly to the team color.
@@ -15,7 +16,7 @@
and hair_team. Please note that those hats currently have no proper
preview images.
-= Data structure =
+== Data structure ==
Hats are specified as PNG files with alpha channel.
They consist of a set sub-images of a size 32px×32px each.
Hedgewars counts the sub-images, or animation frames, from top-left to
@@ -24,12 +25,12 @@
_All_ hats are animated. Even those hats which appear to be “static” (for example: `constructor`)
are animated, too, they use the animation to align the hat to the idle hedgehog.
-== Non-team hats ==
+=== Non-team hats ===
Non-team hats use an image of a total size of 64px×512px. Only the first
19 frames are used, the remainder of the image is currently unused.
It is best to keep this area blank.
-== Team hats ==
+=== Team hats ===
Team hats use an image of a total size of 128px×512px. This image is similar to that of non-team hats, the same pattern is repeated 64 pixels to the right.
The team hat image consists of two “halves”: The left half is the base coloring of the helmet, the right half should _only_ use grayscale colors. The left part may be completely blank. So you have basically two sets of helmet animations. Again, both animations have exactly 19 frames, the remainder is unused.
@@ -39,7 +40,7 @@
Transparent pixels on the right part will not be overlayed. This way, you can decide which parts of the helmet become colored and which won’t.
-= Alignment =
+== Alignment ==
When creating new hats, it is important to now where the hat will be actually placed.
In the game, Hedgewars will use the idling frames (see `Data/Graphics/Hedgehog/Idle.png`)
@@ -80,7 +81,7 @@
This is how to read this table: If you would like to create a simple hat with no fancy animation, like, let’s say, a fedora, you would like the hat to “follow” the hedgehog. You could, for example, draw and align the hat image on the first frame, then copy it on all other frames and apply the offsets to the four “special” frames.
-= Installation =
+== Installation ==
To install a hat, you have to save the file into `Data/Graphics/Hats` in your Hedgewars
user data directory. The file name _must_ end with “`.png`”.
@@ -90,22 +91,22 @@
Hedgewars will always use the very first frame of a hat image to create the preview in the team editor. This also applies to team hats.
-= Templates =
+== Templates ==
For your convenience, we have created some templates to ease the creation of hats. You can use them as background layer to help you align your hats.
-== Non-team hats ==
+=== Non-team hats ===
A basic PNG template is [http://www.hedgewars.org/images/Hat_Template.png Hat_Template.png]. You can use this image as a background layer. This image shows a colored checkerboard pattern, each field represents an animation frame. The green and red fields are those where the idle hedgehog has an offset of +1px or −1 px (see above). The black fields are the unused frames. In the front, the idle hedgehog can be seen but shifted 5 pixels lower and the 5 lowest pixels cut off.
You can use this image to exactly align the hat properly.
This image is also available as XCF for GIMP users: [http://www.hedgewars.org/images/Hat_Template.xcf Hat_Template.xcf]. It got an additional layer and you can easily toggle a couple of layers on and off.
-== Team hats ==
+=== Team hats ===
You can use [http://www.hedgewars.org/images/Team_Hat_Template.png Team_Hat_Template.png]. This is similar to the previous PNG. The hedgehogs on the right half are in gray to remind you that you only should use grayscale colors on this side.
The XCF source of this file is here: [http://www.hedgewars.org/images/Team_Hat_Template.xcf Team_Hat_Template.xcf].
-= Sharing hats =
+== Sharing hats ==
Custom hats (hats which are not part of the official Hedgewars installation) are only visible to other players if they have the hat installed under the same file name.
In case the other player does not have the custom hat installed, the player will see no hat instead.