TransformTextObject(id, sx, rx, ry, sy[, smooth])
TransformTextObject() instead, everything will be
done in a single run.
The 2x2 transformation matrix consists of four floating point factors:
sx:
rx:
ry:
sy:The identity matrix is defined as
( 1 0 ) ( 0 1 ) |
If you pass this matrix, then no transformation will be applied because
there is no rotation and no scaling defined. I.e. if Hollywood applied
this matrix to every pixel in your text object, the result would be just a copy
of the text object. But of course, if TransformTextObject() detects that you passed
an identity matrix, it will return immediately and do nothing.
The optional argument smooth can be set to True if Hollywood shall use
interpolation during the transformation. This yields results that look
better but interpolation is quite slow.
Please note: You should always do transformation operations using the original text object. For instance, if you transform text object 1 to 12x8 pixels and then transform it back to 640x480, you will get a messed text object. Therefore you should always keep the original text object and transform only copies of it.
Note that for vector text objects, TransformTextObject() will always operate on
the untransformed text object. This means that any previous transformations
applied to the text object using TransformTextObject(), ScaleTextObject(),
or RotateTextObject() will be undone when calling
TransformTextObject().
angle = Rad(45) ; convert degrees to radians TransformTextObject(1, Cos(angle), Sin(angle), -Sin(angle), Cos(angle))The code above rotates text object number 1 by 45 degrees using a 2x2 transformation matrix.