Packages
 Comm
 DB
 Debug
 Extension
 Input
 Interface
 Module
 Token
 User

Objects
 bitmapwidget
 databasenode
 dragdata
 textbasecontrol
 textwidget
 tokeninstance
 widget
 widgetcontainer
 windowcontrol
 windowinstance

Controls
 buttoncontrol
 buttonfield
 categoryselectioncontrol
 chatentry
 chatwindow
 databasecontrol
 diecontrol
 diefield
 formattedtextcontrol
 formattedtextfield
 genericcontrol
 imagecontrol
 numbercontrol
 numberfield
 portraitselectioncontrol
 scrollbarcontrol
 scrollercontrol
 stringcontrol
 stringfield
 subwindow
 tokenbag
 tokencontrol
 tokenfield
 windowlist
 windowreferencecontrol
 windowreferencefield

Assets and Settings
 announcement
 categoryselectionsettings
 characterdbroot
 customdie
 description
 desktopframe
 die
 diebox
 distance
 font
 framedef
 hotkeybar
 icon
 imageupdatefolder
 imagesettings
 importinfo
 importruleset
 includefile
 panel
 pollbox
 portraitset
 properties
 replaces
 script
 string
 template
 textsettings
 tokenroot
 tooltip
 windowclass
addDie
getDice
isEmpty
onValueChanged
reset
setDice



Inherits windowcontrol
Context windowinstance

A die control contains a group of dice that can be of different types.

The control supports the "dice" dragdata type. Dropping dice on the control adds them to the list of dice contained in the control. Dragging from the control starts a die roll with the contained dice held.



Definition

<diecontrol name="..." >
<noreset /> Disable reset by using the middle mouse button
</diecontrol>


Interface


addDie

function addDie(type)

Add a die to the list of dice in the control. The specified value should be one of the built in die types ("d4", "d6", "d8", "d10", "d12" or "d20") or a custom die type.

Parameters

type   (string)   

The die identifier


getDice

function getDice()

Get the dice contained in the control.

Return values

(table)
An integer indexed table containing strings specifying the types of the dice in the control

isEmpty

function isEmpty()

Returns whether the control contains dice or is empty.

Return values

(boolean)
Whether the control is empty

onValueChanged

function onValueChanged()

If present, this function is executed whenever the value of this control changes.


reset

function reset()

Empty the control, removing all dice.


setDice

function setDice(dice)

Reset the entire contents of the control to match the list given. The table should contain integer indexed strings identifying the die, either using one of the built in types ("d4", "d6", "d8", "d10", "d12" or "d20") or a custom die type.

Parameters

dice   (table)   

An integer indexed table containing die identifier strings



'Fantasy Grounds' is a trademark of SmiteWorks Ltd. All other trademarks are the property of their respective owners.
© 2004-2010 SmiteWorks Ltd. ALL RIGHTS RESERVED.
Privacy policy