]> git.lizzy.rs Git - dragonblocks.git/blob - doc/Pixel_Manipulator.md
Implement per-map sky
[dragonblocks.git] / doc / Pixel_Manipulator.md
1 #       Pixel Manipulators
2 ##      Constructing
3                 Pixel Manipulators are arrays that look like this:
4                 
5                 pixelmanipulator = [
6                         ["air", "air", "air", "air", "air"],
7                         ["air", "air", "dirt", "air", "air"],
8                         ["air", "dirt", "§air", "dirt", "air]",
9                         ["air", "air", "dirt", "air", "air"],
10                         ["air", "air", "air", "air", "air"]
11                 ];
12 ##      The paragraph sign
13                 You may have noticed that the center block has a "§"
14                 in front of the itemstring. This is not a typo and it is
15                 required to have exactly ONE of these in the manipulator.
16                 It marks the block you have to pass to
17                 dragonblocks.PixelManipulator.apply(x, y).
18                 If you apply the Pixel Manipulator, the coordinates of the
19                 marked node will equal the coordinates you passed to the
20                 method.
21 ##      Using Pixel Manipulators
22 ###             dragonblocks.getPixelManipulator(arr : Array)
23                         Once you got your Pixel Manipulator in form of an array,
24                         pass it to this function. It will return a Pixel
25                         Manipulator object.
26 ###             dragonblocks.PixelManipulator.replace(toReplace : String, replaceWith : String)
27                         If you want to make your code fancier, you can use this function. You
28                         can replace strings you entered into the Manipulator array with other
29                         strings. It's not necessary to use this method.
30 ###             dragonblocks.PixelManipulator.apply(x : int, y : int)
31                         This method enables you to actually place a structure
32                         using Pixel Manipulators.