refhd1.gif - 11Kb


ref1sub1.gif - 10Kb
To create an entirely new canvas you can use the script command. “makecanvas <width> <height> <colour>”. Here <width> and <height> specify the size of the canvas in pixels and <colour> is a hex &RRGGBB (web format) value that sets the background colour.

To load an existing Compo file you can use the command “loadcompo <filename>” where <filename> is the pathname of the file to be loaded. Note that loading a new canvas using this command will mean that any existing objects will be discarded.


ref1sub2.gif - 6Kb
To create a text object you can use the command structure

maketext "textname"
{
 Text: "Hi There!"
 Font: Trinity.Medium
 At: <xposition> <yposition>
 Size: <textwidth> <textheight>
 Colour: &RRGGBB
 Rubout: <opacity> &RRGGBB
 Border: <hborder> <vborder>
 Opacity: <trans>
}


As usual, values can either be immediately given - e.g. here the text is specified as “Hi There!”. Alternatively, variables can be used. The object created is given the name which follows the ‘maketext’ command that heads the structure. The attributes then follow between the curly braces. As with other CompoScript commands, the attribute lines may be omitted or given in any order. Omitted attributes will default to a ‘sensible’ value. The meanings and defaults are as follows:

  meaning and units default
Text Text to be displayed blank
Font Name of the font Last selected font
At Position of bottom left corner of text object w.r.t. to the bottom left corner of the canvas in pixels. 0, 0 (i.e. bottom left of canvas
Size Nominal width and height of characters in points. When only one value is given it will be used for both width and height. Last selected values
Colour Hex ‘RGB’ specification. This uses the same format as the colours on webpages. Last selected value
Rubout Opacity of box as a decimal percentage followed by the colour of the box in RGB format Last selected value
Border Width of the border allowed clear around the text. When only one value is given it will be used for both the vertical (top/bottom) and horizontal (left/right) borders. The border affects the size of the object and sets the limits of the area that will be coloured by a ‘Rubout’ setting. Essentially places the text in a rectangle of the specified colour. Note that the position specified by ‘At’ will refer to the bottom left corner of the box border (i.e. the edge of the object) not the bottom left of the text itself. Values in pixels. Last selected values


Where two values are given they can be specified in various ways: e.g. as ‘8 8’ or ‘8x8’ or ‘8, 8’ as you prefer. In the above ‘Last selected value’ means the values which either were the defaults when Compo was started, or the most recently chosen values obtained via either the normal Text Creation dialogue box, or a previous use of the ‘maketext’ script command.

‘Last Selected Values’ may be taken from the default values or recently used values as appropriate.

Note that if you omit an object name, then the currently selected object (assuming that there is one) will have its blend mask selected and the text will be applied to this. The result will be ‘textured text’ using the currently selected object as the texture. In this case you may force the width and/or height of the text to fit the object by specifying the point size as “FIT”.



prevpage.gif - 1296 bytes homecc2.gif - 8Kb nextpage.gif - 1271 bytes


Content and pages maintained by: Jim Lesurf
using HTMLEdit, Compo, and TechWriter.