tokenbag

Inherits

windowcontrol

Context

windowinstance

The token bag is a specialized dataless control, allowing for the browsing and selection of token types. The control also forms the basic source from where individual token instances can be placed on images and maps and into controls.

The tokens in the control are arranged into nested bags, created from the directory structure in the folders from which the tokens are imported.

The bottom area of the control may contain a series of slots, usable for storing bags for quick access. This bar will automatically be populated with an item for the top level and the previous level in the bag hierarchy.

On the host machine, image files can be dropped on the token bag control to add them to the host's tokens folder.


Definition

<tokenbag name="..." > <tokenarea > ... </tokenarea> <bagbar > <rect > ... </rect> <frame > ... </frame> <slotsize > ... </slotsize> </bagbar> <bag > <icon > ... </icon> <shared > ... </shared> <top > ... </top> <up > ... </up> </bag> <grid > <width > ... </width> <height > ... </height> </grid> <filter > <control > ... </control> <field > ... </field> <casesensitive > ... </casesensitive> </filter> </tokenbag>

<tokenbag name="..." >

 

<tokenarea > ... </tokenarea>

A comma separated list of four numbers, similar to the <bounds> notification on controls, defines the area inside the control in which the tokens are displayed

<bagbar >

Defines the properties of the bar at the bottom of the control, containing shortcuts to bags

<rect > ... </rect>

A comma separated list of four numbers, similar to the <bounds> notification on controls, defines the area inside the control in which the bag bar is displayed

<frame > ... </frame>

The name of the frame resource used to render the bag bar background

<slotsize > ... </slotsize>

Two comma separated numbers, defining the horizontal and vertical dimensions of a single slot on the bag bar, respectively

</bagbar>

 

<bag >

Defines the names of the icon resources to use for bag graphics

<icon > ... </icon>

The icon for a normal bag

<shared > ... </shared>

The icon for a bag from the shared tokens folder

<top > ... </top>

The icon for the first bag bar slot, leading to the top level in the control.

<up > ... </up>

The icon for the second bag bar slot, leading to the level above the current in the bag hierarchy

</bag>

 

<grid >

Defines the size of the grid the tokens are arranged to using the arrange option

<width > ... </width>

The horizontal interval for grid positions

<height > ... </height>

The vertical interval for grid positions

</grid>

 

<filter >

Specifies a filter to be used to filter tokens by file name.

<control > ... </control>

Name of string control to use for filtering.

<field > ... </field>

Name of database node path pointing to a string value to use for filtering.

<casesensitive > ... </casesensitive>

If this tag exists, the filter comparison will be case-sensitive. By default, the filtering is case-insensitive.

</filter>

 

</tokenbag>

 


getZoom

function getZoom()

Returns the current zoom level of the token bag control

Return values

(number)
Scaling factor of token bag view

setZoom

function setZoom(value)

Sets the zoom level of the token bag control.

Parameters

value   (number)   

Desired scaling factor of token bag view