Creates a new Bindings instance that will manage bindings between the specified editor and game component.
the editor that will contain the bound controls
the game component that that will be edited using the controls (default is the editor's current component)
Creates a new Binding using the supplied constructor function and adds it to
this set of bindings. The binding is created as if by calling
new bindClassConstructor(keyName, uiControl, this.component, sheets)
.
If uiControl
is a scroll pane, then the component contained by
the scroll pane will be bound rather than the scroll pane itself.
If bindClassConstructor
is not specified, then a default class will be
searched for using Bindings.getBindingClass
. Most standard control types
have a suitable default binding class available.
the setting key that the control is bound to; if it starts with $
,
the $
will be removed and any underscores (_
) replaced with dashes (-
)
the UI component that will take part in the binding
an array of the indices of the game component's sheets which should be repainted when the bound setting changes; by default all sheets are updated
the constructor function for the Binding subclass that will be used to create the binding; by default a default binding class for the UI control type is looked up from the registry
Adds multiple bindings to this set of bindings. The argument to this method is an array in which
each element is an array of arguments as they would be passed to Bindings.add()
. For example:
bindings.bindAll(
["determination", detmCtrl, [0]],
["special-effect", effectField, [1]],
["hint", hintField, [0,1]]
);
arrays of binding arguments
Binds the editor and game component together, loading the component's current state into the bound controls and installing event listeners that will update the game component when the UI controls are manipulated. A Bindings instance can only be bound once.
Returns a function that will call initComponent()
for all of the
bindings in this set.
a control populator function for these bindings
Returns a function that will update all of the bindings in this set and return whether any of the bound settings were changed.
an update function for the managed bindings
Returns the default binding class for a particular component type, as determined by the specified class. If there is no default binding for the component class, or one of its superclasses, returns null.
the UI control subclass to return a default binding class for
the binding class constructor for the default binding, or null
Registers a binding class constructor to be the default Binding class for a particular type of UI control.
the UI control class that will have a default Binding registered; this may be a Java class or a string that names one
a constructor for a Binding class that can convert between setting strings and control state
Bindings( editor, [gameComponent] ) [ctor] A collection of bindings for a group of custom controls in editor that are bound to settings in gameComponent. If gameComponent is not specified, the game component currently installed in the editor will be used.
editor : the editor that will contain the bound controls gameComponent : the game component that that will be edited using the controls