Go to the Next or Previous section, the Detailed Contents, or the Amiga E Encyclopedia.


11.3.3 Graphics functions

The functions in this section use the standard raster port, the address of which is held in the variable stdrast. Most of the time you don't need to worry about this because the E functions which open windows and screens set up this variable (see 11.3.2 Intuition support functions). So, by default, these functions affect the last window or screen opened. When you close a window or screen, stdrast becomes NIL and calls to these functions have no effect. There is a worked example using these functions in Part Three (see 22.3 Graphics).

The descriptions in this section follow the same style as the previous section.

Plot(x,y,pen=1)
Plots a single point (x,y) in the specified pen colour. The position is relative to the top, left-hand corner of the window or screen that is the current raster port (normally the last screen or window to be opened). The range of pen values available depend on the screen setup, but are at best 0-255 on AGA machines and 0-31 on pre-AGA machines. As a guide, the background colour is usually pen zero, and the main foreground colour is pen one (and this is the default pen). You can set the colours of pens using the SetColour function.

Line(x1,y1,x2,y2,pen=1)
Draws the line (x1,y1) to (x2,y2) in the specified pen colour.

Box(x1,y1,x2,y2,pen=1)
Draws the (filled) box with vertices (x1,y1), (x2,y1), (x1,y2) and (x2,y2) in the specified pen colour.

Colour(fore-pen,back-pen=0)
Sets the foreground and background pen colours. As mentioned above, the background colour is normally pen zero and the main foreground is pen one. You can change these defaults with this function, and if you stick to having the background pen as pen zero then calling this function with one argument changes just the foreground pen.

TextF(x,y,format-string,arg1,arg2,...)
This works just like WriteF except the resulting string is drawn on the current raster port (usually the last window or screen to be opened) ,starting at point (x,y). Take care not to use any line-feed, carriage return, tab or escape characters in the string--they don't behave like they do in WriteF.

SetColour(scrnptr,pen,r,g,b)
Sets the colour of colour register pen for the screen pointed to by scrnptr to be the appropriate RGB value (i.e., red value r, green value g and blue value b). The pen can be anything up to 255, depending on the screen depth. Regardless of the chipset being used, r, g and b are taken from the range zero to 255, so 24-bit colours are always specified. In operation, though, the values are scaled to 12-bit colour for non-AGA machines.

SetStdRast(newrast)
Returns the value of stdrast before setting it to the new value. The following code fragments are equivalent:

  oldstdrast:=SetStdRast(newstdrast)

  oldstdrast:=stdrast
  stdrast:=newstdrast

SetTopaz(size=8)
Sets the text font for the current raster port to Topaz at the specified size, which defaults to the standard size eight.


Go to the Next or Previous section, the Detailed Contents, or the Amiga E Encyclopedia.