Class R.ui.TextInputControl
Extends
R.ui.AbstractUIControl.
UI input control for the input of a single line of text.
Defined in: textinputcontrol.js.
Constructor Attributes | Constructor Name and Description |
---|---|
R.ui.TextInputControl(size, maxLength)
|
- Fields borrowed from class R.struct.Container:
- EMPTY
Method Attributes | Method Name and Description |
---|---|
Calculate and return the height of the control in pixels.
|
|
calcWidth(str)
Calculate and return the width of the control in pixels.
|
|
deserialize(obj, clazz)
Deserialize the object back into a text input control.
|
|
destroy()
Destroy the text input control, releasing its event handlers.
|
|
drawCaret(renderContext, worldTime, dt)
Draw the input caret.
|
|
drawControl(renderContext, worldTime, dt)
Draw the input component within the
|
|
Get the class name of this object
|
|
Returns a bean which represents the read or read/write properties
of the object.
|
|
getText()
Get the value of the input control.
|
|
release()
Releases the object back into the object pool.
|
|
serialize(obj, defaults)
Get a properties object with values for the given object.
|
|
setMaxLength(maxLength)
Set the maximum length of input allowed.
|
|
setPassword(state)
Set a flag indicating this is a password field.
|
|
setSize(size)
Set the number of characters to display in the input.
|
|
setText(text)
Set the value of the input control.
|
- Methods borrowed from class R.ui.AbstractUIControl:
- addClass, click, drawBox, getControlName, getGroup, getGroupName, getTextRenderer, hasFocus, isMouseInControl, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, removeClass, setControlName, setFocus, setGroup
- Methods borrowed from class R.objects.Object2D:
- getAABB, getBoundingBox, getBoundingCircle, getCollisionHull, getDefaultTransformComponent, getLastPosition, getOrigin, getOriginPosition, getPosition, getRenderPosition, getRenderRotation, getRotation, getScale, getScaleX, getScaleY, getTransformationMatrix, getWorldBox, getWorldCircle, getZIndex, setBoundingBox, setCollisionHull, setDefaultTransformComponent, setOrigin, setPosition, setRotation, setScale, setZIndex
- Methods borrowed from class R.engine.GameObject:
- add, componentSort, getComponent, getComponentByClass, getRenderContext, isDirty, isKeepAlive, markDirty, remove, setKeepAlive, setRenderContext, update, wasDirty
- Methods borrowed from class R.struct.HashContainer:
- cleanUp, clear, get, isInHash, removeAtIndex, removeHash
- Methods borrowed from class R.struct.Container:
- addAll, append, clone, concat, contains, filter, forEach, fromArray, getAll, getObjects, insert, iterator, reduce, replace, replaceAt, size, sort, subset, toXML
- Methods borrowed from class R.engine.BaseObject:
- addEvent, addEvents, getElement, jQ, removeEvent, setElement, triggerEvent
- Methods borrowed from class R.engine.PooledObject:
- clearObjectDataModel, getId, getName, getObjectDataModel, isDestroyed, setName, setObjectDataModel, toString
Class Detail
R.ui.TextInputControl(size, maxLength)
- Parameters:
- size Optional, Default: 10
- {Number} The number of visible characters in the context.
- maxLength Optional, Default: 0
- {Number} The maximum number of allowed characters. Zero for unlimited text length.
Method Detail
{Number}
calcHeight()
Calculate and return the height of the control in pixels.
- Returns:
- {Number}
{Number}
calcWidth(str)
Calculate and return the width of the control in pixels.
- Parameters:
- str
- Returns:
- {Number}
{R.ui.TextInputControl}
deserialize(obj, clazz)
Deserialize the object back into a text input control.
- Parameters:
- obj
- {Object} The object to deserialize
- clazz Optional
- {Class} The object class to populate
- Returns:
- {R.ui.TextInputControl} The object which was deserialized
destroy()
Destroy the text input control, releasing its event handlers.
drawCaret(renderContext, worldTime, dt)
Draw the input caret.
- Parameters:
- renderContext
- {R.rendercontexts.RenderContext2D} The render context where the control is drawn.
- worldTime
- {Number} The current world time, in milliseconds
- dt
- {Number} The time since the last frame was drawn by the engine, in milliseconds
drawControl(renderContext, worldTime, dt)
Draw the input component within the
- Parameters:
- renderContext
- {R.rendercontexts.RenderContext2D} The render context where the control is drawn.
- worldTime
- {Number} The current world time, in milliseconds
- dt
- {Number} The time since the last frame was drawn by the engine, in milliseconds
{String}
getClassName()
Get the class name of this object
- Returns:
- {String} The string "R.ui.TextInputControl"
{Object}
getProperties()
Returns a bean which represents the read or read/write properties
of the object.
- Returns:
- {Object} The properties object
{String}
getText()
Get the value of the input control.
- Returns:
- {String}
release()
Releases the object back into the object pool. See R.engine.PooledObject#release
for more information.
{Object}
serialize(obj, defaults)
Get a properties object with values for the given object.
- Parameters:
- obj
- {R.ui.TextInputControl} The text input control to query
- defaults Optional
- {Object} Default values that don't need to be serialized unless they are different.
- Returns:
- {Object}
setMaxLength(maxLength)
Set the maximum length of input allowed.
- Parameters:
- maxLength
- {Number} Maximum allowed input length
setPassword(state)
Set a flag indicating this is a password field.
- Parameters:
- state
- {Boolean}
true
to mask the characters
setSize(size)
Set the number of characters to display in the input.
- Parameters:
- size
- {Number} The number of characters to display
setText(text)
Set the value of the input control.
- Parameters:
- text
- {String} Text