[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.3.4.9 Graphics-Mode Text/Shape Attributes (%A)

This command has two related functions:

Graphics-Mode Text/Shape Attributes sets all of the attributes--location, font, size, color, and justification--to control the display of text in the graphics modes.

The Graphics-Mode Text Display command (#G) is then used to display text with the specified attributes.

--and--

Graphics-Mode Text/Shape Attributes sets all of the attributes--location, size, color, justification, and "display now" attribute--to control the display of shapes in graphics modes. Currently, "square" is the only shape.

The Display Shape command (#H) is then used to display the shape with the specified attributes.

There are six possible arguments to %A, all of which are optional. If an argument is not specified, it will remain either the default value, or the value it was changed to last. Each argument is a letter, immediately followed by a number with no space. Arguments are separated by commas.

Text function:

The X argument specifies the horizontal location of text on the screen, with valid values of X being X0 (left-hand side of screen) through X639 (right-hand side of screen).

The Y argument specifies the vertical location of text on the screen, with valid values of Y being Y0 (top of screen) through Y479 (bottom of screen).

There are three fonts used in graphics mode. These fonts are specified using the "F" argument, and the numbers 0, 1, or 2, where F0 specifies 12-point Bookman Bold; F1 specifies 24-point Arial; F2 specifies 14-point Courier.

Previous incarnations used the "S" argument to specifiy the size of the font, but that is not used in Cogsys 4.

The J argument specifies justification of text, with valid values of: J0 specifying that the top-left corner of the text is located at [X,Y]; J1 specifying that the top-right corner of the text is located at [X,Y]; J2 specifying that the center of the text is located at [X,Y].

The C argument specifies the color of the text, as described in the A. Standard Palette section. The background color is not affected.

The default values for the text attributes are given below:

cursor position
X0,Y0 (top left of screen)
font
font F0, 12-point Bookman Bold
font size
S1 (not used)
color
color palette C15 (white)
justification
J0 (left)

Name:
Graphics-Mode Text/Shape Attributes
Class:
Display Text
Code:
%A
Syntax:
%A[ [Xx | Yy | Jjust | Ffont | Sscale | Ccolor] [, ...] ]
x is an integer from 0 to one less than width of the current video mode
y is an integer from 0 to one less than height of the current video mode
just represents text justification as 0 (left), 1 (right), or 2 (center)
font is an integer from 0 to 2, which represents which font to use from the font table
scale is not used
color is an index to the color palette for this video mode (from 0 to one less than maximum number of colors) Note that the syntax definition allows the specification of as many attributes as you like in any order. If the same attribute is specified more than once, the last occurrence is used.
System:
Sets the graphics attributes specified. The cursor is moved to position x,y. Depending on the value of just, text will be aligned to either the right, left, or center of x,y. The text will be displayed in color color. The font is selected by an index to the font table, as described above.

Once set, an attribute is not changed until another %A command. Attributes retain their values through mode resets.

Requires:
Cogsys must be in a graphics mode.

Test Files:
`GATRG_T01.IN'
tests basic operation

Examples:

input
%M2%A[X320,Y240,J2,S1,F1,C11]#G[Press space bar]
cogsys
Displays the string `Press space bar' in 14-point Courier at the center of the screen in bright yellow.

Shape function:

The X argument specifies the horizontal location of shapes on the screen, with valid values of X being X0 (left-hand side of screen) through X639 (right-hand side of screen).

The Y argument specifies the vertical location of shapes on the screen, with valid values of Y being Y0 (top of screen) through Y479 (bottom of screen).

Shapes can be displayed immediately, or delayed. Delaying display will allow the testlist to build a screen with multiple shapes and then to display all of them at once. The F1 argument displays the shape immediately (flips the screen), and the F0 argument delays the display (does not flip the screen).

The S argument is the size of the shape in pixels. For squares, this is the length of each edge of the square. The size can go from S1 to S640, to fill the entire screen.

The J argument specifies justification of shapes, with valid values of: J0 specifying that the top-left corner of the shape is located at [X,Y]; J1 specifying that the top-right corner of the shape is located at [X,Y]; J2 specifying that the center of the shape is located at [X,Y].

The C argument specifies the color of the shape, as described in the A. Standard Palette section. The background color is not affected.

The default values for the text attributes are given below:

cursor position
X0,Y0 (top left of screen)
flip-now
F1, flip now
shape size
S1, one pixel in size
color
color palette C15 (white)
justification
J0 (left)

Name:
Graphics-Mode Text/Shape Attributes
Class:
Display Text
Code:
%A
Syntax:
%A[ [Xx | Yy | Jjust | Ffont | Sscale | Ccolor] [, ...] ]
x is an integer from 0 to one less than width of the current video mode
y is an integer from 0 to one less than height of the current video mode
just represents text justification as 0 (left), 1 (right), or 2 (center)
font tells the shape to be displayed immediately (F1), or to be delayed (F0)
scale is the size of the shape in pixels
color is an index to the color palette for this video mode (from 0 to one less than maximum number of colors) Note that the syntax definition allows the specification of as many attributes as you like in any order. If the same attribute is specified more than once, the last occurrence is used.
System:
Sets the graphics attributes specified. The cursor is moved to position x,y. Depending on the value of just, the shape will be aligned to either the right, left, or center of x,y. The shape will be displayed in color color.

Once set, an attribute is not changed until another %A command. Attributes retain their values through mode resets.

Requires:
Cogsys must be in a graphics mode.

Test Files:
`GATRH_T01.IN'
tests basic operation

Examples:

input
%M2%A[X320,Y240,J2,S60,F1,C11]#H[]
cogsys
Displays a bright yellow square, side length 60, in the center of the screen .


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on November, 24 2008 using texi2html