10.9 Inbuilt constants

The inbuilt constants are used by many functions as descriptors for a special action. Therefore, their function is different from constant to constant. If a function requires a special constant as an argument (e.g. SetFontStyle() accepts the constants #BOLD, #ITALIC, #NORMAL and #UNDERLINED), then those constants are described in the documentation for that command.

Additionally there are some constants that can be specified everytime a Hollywood function asks you for a x or y coordinate. These constants are the so-called "position constants". They allow you to easily specify some often used positions. The following position constants are inbuilt in Hollywood:

The following constants can be used as a x-coordinate:

#CENTER:
Specifies the center of your display (= (displaywidth-objectwidth) / 2)

#LEFT:
Specifies the left edge of your display (= 0)

#LEFTOUT:
Specifies the outer left of your display (= -objectwidth)

#RIGHT:
Specifies the right edge of your display (= displaywidth-objectwidth)

#RIGHTOUT:
Specifies the outer right of your display (= displaywidth+objectwidth)

#USELAYERPOSITION:
Specifies the current x-position of the layer.

The following constants can be used as a y-coordinate:

#CENTER:
Specifies the center of your display (= (displayheight-objectheight)/2)

#TOP:
Specifies the top edge of your display (= 0)

#TOPOUT:
Specifies the outer top of your display (= -objectheight)

#BOTTOM:
Specifies the bottom edge of your display (= displayheight-objectheight)

#BOTTOMOUT:
Specifies the outer bottom of your display (= displayheight+objectheight)

#USELAYERPOSITION:
Specifies the current x-position of the layer.

These constants make it very easy for you to position your objects. For example if you want to display brush 1 in the center of the display, just call DisplayBrush() with the arguments 1, #CENTER, #CENTER et voila!

You can even fine-tune the positions by subtracting and adding values to these constants! For example, DisplayBrush(1, #CENTER, #CENTER + 25) displays brush one 25 pixels below the vertical center of the display.

There are also some constants that allow you to easy access some basic colors. The following color constants are currently declared by default: #BLACK, #MAROON, #GREEN, #OLIVE, #NAVY, #PURPLE, #TEAL, #GRAY, #SILVER, #RED, #LIME, #YELLOW, #BLUE, #FUCHSIA, #AQUA, #WHITE.

Finally, Hollywood defines some platform-specific constants depending on the platform it is currently running on or compiling for. You can use the @IF preprocessor command to test for those constants and take desired action. You can find these platform-specific constants in the section on the @IF preprocessor command in this documentation. See IF for details.


Show TOC