[id] = CopyBrush(source, dest[, table])
source
and creates a copy of
it in brush dest
. The new brush is independent from the old brush so you
could free the source brush after it has been cloned.
If you pass Nil as dest
, CopyBrush()
will return a handle to the new
brush to you. Otherwise the new brush will use the identifier specified
in dest
.
Starting with Hollywood 5.0, this function accepts an optional table argument which accepts the following fields:
Hardware:
True
, Hollywood will create this brush entirely
in video memory for hardware-accelerated drawing in connection with
a hardware double buffer. Hardware brushes are subject to several
restrictions. See hardware brushes for details. (V5.0)
Display:
Hardware
tag has been set to True
. Also note that Hollywood's inbuilt
display adapter does not support display-dependent hardware brushes,
but plugins can install custom display adapters which support display-dependent
hardware brushes. This tag defaults to the identifier of the currently active display.
See hardware brushes for details. (V6.0)
SmoothScale:
True
and the Hardware
tag has also been set to
True
, Hollywood (or display adapters) will use bilinear interpolation when
transforming the newly created brush. Normally, whether interpolation shall be used or
not is set when calling a brush transformation command like ScaleBrush()
or RotateBrush() but some display adapters need to
know this information already at the time a hardware brush is created, and
this is why this tag is here, though it's probably of not much use because
it's only needed in rather special situations with display adapters like
RebelSDL or hardware brushes on Android, because normally you can just
specify whether interpolation shall be used or not in the transformation command directly.
Note that SmoothScale
is only supported when Hardware
is set to True
. (V8.0)
dest
CopyBrush(1, 10) FreeBrush(1)The above code creates a new brush 10 which contains the same graphics data as brush 1. Then it frees brush 1 because it is no longer needed.