Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

<imagecontrol name="..." >

<indicators >

This section contains names for bitmaps used to indicate image control state

<availability > ... </availability>

The name of the icon resource used to notify the host user that all clients have downloaded the image being displayed

<locked > ... </locked>

The name of the icon resource used to notify that the drawing layer is locked

<zoom > ... </zoom>

The name of the icon resource used to notify that the active zoom level is different from 100%

<shortcuts > ... </shortcuts>

The name of the icon resource used to notify the host user that the shortcuts are being displayed and can be manipulated

<loading > ... </loading>

The name of the icon resource used for client users to draw a notification in the middle of the control when the image is being downloaded

</indicators>

<shortcut >

Information about the image used to represent shortcuts

<icon > ... </icon>

The name of the icon resource used to draw the shortcut

<hotspot > ... </hotspot>

The offset on the bitmap representing the location to pinpoint shortcut, as two comma separated numbers

</shortcut>

<default >

Specify default settings for the control

<gridtype > ... </gridtype>

The type of grid to set by default (hexrow, hexcolumn, square). The default value is square, if not defined.

<gridsize > ... </gridsize>

The size in pixels of the grid units (square or hex). The default value is zero (which means no grid).

<gridoffset > ... </gridoffset>

The X and Y coordinates to offset the first grid square from the upper left corner of the map. The default value is (0,0).

<snap > ... </snap>

Defines whether tokens and pointers are automatically snapped to grid. Valid values are "on" and "off". If the underlying image database value already has a snap setting (specified by GM or imagecontrol), then this value is ignored on load.

<snapsquare > ... </snapsquare>

Defines the grid snap style when using a rectangular grid. Valid values are ("center", "vertexandcenter"). The default style is "vertexandcenter".

<snaphex > ... </snaphex>

Defines the grid snap style when using a hex grid. Valid values are ("center", "vertexandcenter"). The default style is "center".

<drawingsize > ... </drawingsize>

The size used for the initial imagecontrol drawing, if the image record is a pure drawing (i.e. created by GM, not by image in the campaign images directory)

</default>

<pointertypes >

<arrow >

Optional. Enable arrow pointer.

<icon > ... </icon>

Radial menu icon.

<label > ... </label>

Radial menu text.

</arrow>

<circle >

Optional. Enable circle pointer.

<icon > ... </icon>

Radial menu icon.

<label > ... </label>

Radial menu text.

</circle>

<rectangle >

Optional. Enable square pointer.

<icon > ... </icon>

Radial menu icon.

<label > ... </label>

Radial menu text.

</rectangle>

<cone >

Optional. Enable cone pointer.

<icon > ... </icon>

Radial menu icon.

<label > ... </label>

Radial menu text.

<angle > ... </angle>

Angle of cone pointers on this image. Default value is 90. Valid values are 180, 120, 90, 60, 45, 30 and 5E.

</cone>

<custom >

Optional. Allows multiple. Enable custom pointer.

<name > ... </name>

Custom pointer name.

<icon > ... </icon>

Radial menu icon.

<label > ... </label>

Radial menu text.

</custom>

</pointertypes>

</imagecontrol>

...

This utility function helps with the location of points on the hex grid. Hexes are drawn by treating the grid size as the a number of pixels between opposing straight sides (vertical or horizontal depending on the type). The hexagonal shape is then calculated in an integer approximation by calculating a "half height" value (half of the grid size, rounded down) and a "quarter width" (grid size * tan(30 degrees) / 2, rounded down). The size of the hex is then considered to be twice the half height from straight side to straight side, and four times the quarter width along the longest axis.

...

(number)
The horizontal offset of the grid

(number)
The vertical offset of the grid

...

Code Block
languagelua
function getGridSize()

Get Returns the size of the grid squares in pixels. The grid is rectangular, i.e. the height and width of the squares is the same.

...

(number)
The size of the grid squares in pixels. If the grid is disabled, returns 0.

getGridSnap

Code Block
languagelua
function getGridSnap()

...

pixellength   (number)   
The length of the pointer in pixels

pointertype   (string)   
The type of the pointer: "arrow", "circle", "cone", "rectangle"

...

size   (number)   
The size of the grid in pixels

setGridSnap

Code Block
languagelua
function setGridSnap(snapenable)

...