Skip to content

図形配列拡張仕様

Nonki Takahashi edited this page Apr 10, 2020 · 11 revisions

図形配列拡張仕様

Version 1.0.3
たかはしのんき

目的

This specification defines the polygon extension for shape array in Microsoft Small Basic programming language. The typical application of the polygon extension is the Anime editor.

Requirements

This specification assumes following systems.

  • Small Basic v1.2
  • LitDev Extension

Definitions

This specification defines the additional data format of the shape 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 - function is poly (polygon).
  • 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 polygon and text.
  • height - height for polygon and text.
  • bc - the color of the brush such as #FFFF00.
  • pc - the color of the pen such as #000000.
  • pt - pairs of the x and y co-ordinate for a polygon vertices such as "100,100 200,100, 200,200 100,200".
  • name - the user defined name of the polygon or text.
  • 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.

polygon

Virtual Functions (Read Only)

These functions are read only and converted other functions above.

  • func - function is only path.
  • d - path definition just like SVG.

Subroutines

  • Shapes_Init - initializes the shape array and the offset shX and shY.
  • Shapes_CalcWidthAndHeight - (internal use only) calculates total width and height of shapes.
  • Shapes_CalcRotateZoomPos - (internal use only) calculates position for rotated and zoomed shape.
  • Sprite_Add - adds the shapes as a sprite with a name.
  • Sprite_Flip - flips a sprite of shapes by angle around the y axis.
  • Sprite_Hide - hides a sprite of shapes.
  • Sprite_Move - moves a sprite of shapes to (x, y).
  • Sprite_Remove - removes a sprite of shapes.
  • Sprite_Rotate - rotates a sprite of shapes by angle around the z axis.
  • Sprite_Show - shows a sprite of shapes
  • Sprite_Zoom - zooms a sprite of shapes.

関連項目

他の言語