Minecraftmodcustomstuff Wiki
(added bug about hexadecimal colors)
m (Bug is now fixed)
Line 85: Line 85:
 
This is the color of the string. The values for color tries to follow the hexadecimal RBG format. After the '0x', the first two digits are for red, the second two digits are for green, and the final two digits are for blue. Unfortunately, there seems to be a bug in the values. If you want to have no problems with colors, make sure the first 2 digits (red) is not greater than 97. Refer to the bugs section for more details about this bug. If you need help getting a specific color, sites like [http://www.colorpicker.com/ colorpicker.com] can give you the code that goes after the 0x for specific colors.
 
This is the color of the string. The values for color tries to follow the hexadecimal RBG format. After the '0x', the first two digits are for red, the second two digits are for green, and the final two digits are for blue. Unfortunately, there seems to be a bug in the values. If you want to have no problems with colors, make sure the first 2 digits (red) is not greater than 97. Refer to the bugs section for more details about this bug. If you need help getting a specific color, sites like [http://www.colorpicker.com/ colorpicker.com] can give you the code that goes after the 0x for specific colors.
 
==Bugs==
 
==Bugs==
*As of Custom Stuff 2.2.0, there seems to be a problem converting high numbers of hexadecimal into color properly. The sets of numbers for colors seem to react to eachother to cause errors so a list of maximum values is provided below.
+
*In Custom Stuff 2.2.0 (fixed now), there seems to be a problem converting high numbers of hexadecimal into color properly. The sets of numbers for colors seem to react to eachother to cause errors so a list of maximum values is provided below.
 
**Maximum value for the first 2 digits (red) without problems is 98, this effects how high other values can be though so a list of thoses are provided below.
 
**Maximum value for the first 2 digits (red) without problems is 98, this effects how high other values can be though so a list of thoses are provided below.
 
***0x989679 (98 red, 96 green, 79 blue)
 
***0x989679 (98 red, 96 green, 79 blue)

Revision as of 18:23, 10 February 2012

Guis are windows in minecraft, that you can open for example when rightclicking a block. There are different types of guis, but at the moment there are only for crafting guis.

To open a gui you use this function, called with the function trigger of your choice:

customstuff.openGui(world, origin, 'name123', player); // This will open the gui of which name attribute is set to "name123".

You only need to change "name123" to the name of the gui you're referencing (see below), leaving the single quotes on each side of it.

An example of a gui (which is also found in you customGuis folder):

name = "defaultcraft4x4";
type = "crafting4x4";
guifile = "customstuff/textures/crafting4x4.png";
id = 61;
width = 194;
height = 184;
resultx = 142;
resulty = 44;
craftingx = 30;
craftingy = 17;
upperinvx = 17;
upperinvy = 102;
lowerinvx = 17;
lowerinvy = 160;

stringtext1 = "Crafting";
stringx1 = 28;
stringy1 = 6;
stringcolor1 = 0x404040;

stringtext2 = "Inventory";
stringx2 = 17;
stringy2 = 90;
stringcolor2 = 0x404040;
Craftingex

This image shows the special points on the gui.

name

The name of the gui mentioned above.

type

The type of the gui. Here a 4x4 crafting field.

guifile

The gui image that is displayed when you open the gui. It is a 256x256 png file.

id

The id of the gui. This is used if you play on a server. It is a unique id.

width

This is used if your gui is smaller than 256x256. If set this to 100 the game will only use the first 100 pixels (starting at the left border; The black line at the bottom of the image represents the width).

height

This is used if your gui is smaller than 256x256. If set this to 100 the game will only use the first 100 pixels (starting at the top border; The black line at right of the image represents the height).

resultx / resulty

Those are the X and Y coordiates of the result slot (The blue pixel on the image).

craftingx / craftingy

Those are the X and Y coordinates of top-left slot in the crafting field (The red pixel on the image).

upperinvx / upperinvy

Those are the X and Y coordinates of the top-left slot of the upper three rows of the inventory (The green pixel on the image).

lowerinvx / lowerinvy

Those are the X and Y coordinates of the left slot of the bottom row of the inventory (The yellow pixel on the image).

stringtext[x]

This is the x. text of a string that should rendered onto the gui. You can use up to 16 strings (stringtext1 to stringtext16) same to the other string attributes.

stringx[x] / stringy[x]

Those are the X and Y coordinates of the string.

stringcolor[x]

This is the color of the string. The values for color tries to follow the hexadecimal RBG format. After the '0x', the first two digits are for red, the second two digits are for green, and the final two digits are for blue. Unfortunately, there seems to be a bug in the values. If you want to have no problems with colors, make sure the first 2 digits (red) is not greater than 97. Refer to the bugs section for more details about this bug. If you need help getting a specific color, sites like colorpicker.com can give you the code that goes after the 0x for specific colors.

Bugs

  • In Custom Stuff 2.2.0 (fixed now), there seems to be a problem converting high numbers of hexadecimal into color properly. The sets of numbers for colors seem to react to eachother to cause errors so a list of maximum values is provided below.
    • Maximum value for the first 2 digits (red) without problems is 98, this effects how high other values can be though so a list of thoses are provided below.
      • 0x989679 (98 red, 96 green, 79 blue)
      • 0x9895FF (98 red, 96 green, 255 blue)
    • If red is any value below 98, all values up to ff (255) can be used for green and blue, making 0x97FFFF be a valid color for stringcolor[x]