Shape Array Specification - nonkit/Shapes GitHub Wiki

Shape Array Specification

Version 2.1.9 Nonki Takahashi

Purpose

This specification defines the shape array in Microsoft Small Basic programming language. The typical application of the shape array is the Shapes editor.

Definitions

This specification defines the data format of the shapes array and subroutines to manipulate the array.

Data Format

The Array The name of the array is shape.

Indices In the shape array, following indices are used.

  • func - functions such as rect (rectangle), ell (ellipse), tri (isosceles triangle), line, img (image), and text.
  • x - the x co-ordinate on the left of the shape.
  • y - the y co-ordinate on the top of the shape.
  • width - width for rectangle, ellipse and image.
  • height - height for rectangle, ellipse and image.
  • bc - the color of the brush such as #FFFF00.
  • pc - the color of the pen such as #000000.
  • x1 - the x co-ordinate for the first point a line or for the vertex point of an isosceles triangle.
  • y1 - the y co-ordinate for the first point a line or for the vertex point of an isosceles triangle.
  • x2 - the x co-ordinate for the second point a line or for the left base point of an isosceles triangle.
  • y2 - the y co-ordinate for the second point a line or for the left base point of an isosceles triangle.
  • x3 - the x co-ordinate for the right base point of an isosceles triangle.
  • y3 - the y co-ordinate for the right base point of an isosceles triangle.
  • text - the text string for a text.
  • fn - the font name for a text.
  • fs - the font size for a text.
  • fb - "TRUE" if font bold for a text.
  • fi - "TRUE" if font italic for a text.
  • name - the user defined name of the shape.
  • obj - (internal use only) the system provided shape name.
  • rx - (internal use only) the x co-ordinate of original point for rotated shape.
  • ry - (internal use only) the y co-ordinate of original point for rotated shape.
  • wx - (internal use only) the x co-ordinate of Silverlight workaround point for rotated shape.
  • wy - (internal use only) the y co-ordinate of Silverlight workaround point for rotated shape.

triangle

Virtual Functions (Read Only)

These functions are read only and converted other functions above.

  • func - hex (hexagon), para (parallelogram) and trap (trapezoid) .
  • ratio - relative x position per height for the top left vertex (default value is 0.25).

hexagon

Subroutines

  • Shapes_Init - initializes the shape array and the offset shX and shY.
  • Shapes_Convert - converts virtual functions to functions between iMin and iMax. Then returns new iMax.
  • Shapes_CalcWidthAndHeight - (internal use only) calculates total width and height of shapes.
  • Shapes_CalcRotateZoomPos - (internal use only) calculates position for rotated and zoomed shape.
  • Group_Add - adds the shapes as a group with a name.
  • Group_Flip - flips a group of shapes by angle around the y axis.
  • Group_Hide - hides a group of shapes.
  • Group_Move - moves a group of shapes to (x, y).
  • Group_Remove - removes a group of shapes.
  • Group_Rotate - rotates a group of shapes by angle around the z axis.
  • Group_Show - shows a group of shapes.
  • Group_Zoom - zooms a group of shapes.

See Also

Other Languages