Name
DisplayBGPicPart -- display a part of a background picture
Synopsis
DisplayBGPicPart(id, x, y, width, height[, dx, dy, table])
Function
This function displays a tile of the background picture specified by id on the screen. The tile is defined by x, y and its width and height.

If layers are enabled, this command will add a new layer of the type #BGPICPART to the layer stack.

As of Hollywood 4.0, this command uses a new syntax, although the old syntax is still supported for compatibility reasons. New scripts should use the new syntax, though. The new syntax accepts a table as the last argument which allows you to specify several further options:

Layers:
If you set this to True, the layers (in case layers are enabled) or the foreground graphics (in case layers are disabled) of the background picture are drawn, too. This is useful if you want to create an exact copy of a background picture in a brush, for example. Please note that if layers are disabled, you can use this argument only if id specifies the identifier of the current background picture because Hollywood does not keep the entire foreground contents of all background pictures if layers are disabled.

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.

Inputs
id
identifier of the background picture to use as source
x
left corner
y
top corner
width
width of the tile
height
height of the tile
dx
optional: destination x-position for the tile (defaults to x) (V1.5)
dy
optional: destination y-position for the tile (defaults to y) (V1.5)
table
optional: further configuration table
Example
DisplayBGPicPart(2,0,0,100,100)
Display the first 100 pixels and rows from background picture 2 on the screen at position 0:0.


width = GetAttribute(#DISPLAY, 0, #ATTRWIDTH)
height = GetAttribute(#DISPLAY, 0, #ATTRHEIGHT)
id = GetAttribute(#DISPLAY, 0, #ATTRBGPIC)
CreateBrush(1, width, height)
SelectBrush(1)
DisplayBGPicPart(id, 0, 0, width, height, {Layers = TRUE})
EndSelect
This code makes a copy of the current display contents in brush 1.

Show TOC