Box(x, y, width, height[[, color], table])
x
and y
in the dimensions specified by width
and height
using the specified color (RGB value).
The rectangle will be drawn in the form
style specified using SetFormStyle() and will be filled according to the
configuration selected with SetFillStyle().
If layers are enabled, this command will add a new layer of the type
#BOX
to the layer stack.
New in Hollywood 2.0: Color can also be an ARGB value for alpha-blended drawing.
Starting with Hollywood 4.5 this function uses a new syntax with just a single table as an optional argument. The old syntax is still supported for compatibility reasons. The optional table argument can be used to configure the style of the box. The following options are possible:
RoundLevel:
CornerA, CornerB, CornerC, CornerD:
RoundLevel
tag. (V5.0)
Furthermore, the optional table argument can also contain one or more of the standard tags for all drawing commands. See Standard drawing tags for more information about the standard tags that nearly all Hollywood drawing commands support.
Note that when drawing to a palette-based target and the palette mode is set
to #PALETTEMODE_PEN
, this function will draw using the pen set via SetDrawPen()
instead of the color passed to the function.
#BLACK
)
color is optional because it is not required when you
render to a mask or alpha channelBox(0, 0, 640, 480, #YELLOW)The above code draws a yellow box as a border of the 640x480 display.
Box(0, 0, 300, 200, #RED, {RoundLevel = 25})The code above draws a red box with corners rounded by 25%.