The Draw component allows the NewBASIC programmer access to the lowest level of graphics functionality in the New Deal operating system. The underlying implementation of this component is the same human optimized assembly code in the kernel that powers drawing of the user interface. Draw components write internally stored and manipulated gstring structures.
data complex
This value stors the actual graphics string as a complex. This value can be passed to other components when setting their .graphic properties.
This action begins defining a graphic string object to draw. This must be the first action sent to a draw component. All subsequent actions are stored within the draw component until a stop() action is recieved. This action instructs the New Deal subsystem to create an initial gstring.
left
The left boundry of the rectangle.
top
The top boundry of the rectangle.
right
The right boundry of the rectangle.
bottom
The bottom boundry of the rectangle.
polygon(points as array[][], count as integer) as integer
This action adds the given polygon to the draw component. This action passes a set of count points within a two dimensional array passed in the points data.
areacolor(color as integer) as integer
This action sets the current area color for a draw component. Future filled components will be drawn using this color.
linecolor(color as integer) as integer
Thsi action sets the current line color for a draw component. Future drawn components will be drawn using this color.
moveto(x as integer, y as integer) as integer
This action moves the current cursor position of the draw component to the given point, based on the upper left corner as the origin (0,0).
drawlineto(x as integer, y as integer) as integer
This action adds a line from the current cursor position to the given point to the draw component.
text(text as string) as integer
This action adds text at the current cursor position to the draw component.