public class Selector extends FeaturableModel implements SelectorConfigurer
Rectangle
representing the
selection. Usage example:
setClickableArea(Viewer)
- Required to define the area where selection is allowedsetClickSelection(int)
- Recommended to set which mouse click should be used to start selectionsetSelectionColor(ColorRgba)
- Optional for a custom color selectionaddListener(SelectorListener)
to notify them the computed selection.
It will be then easy to check if objects are inside this area, and set them as selected.SelectorListener
,
Cursor
,
Viewer
Constructor and Description |
---|
Selector()
Create the selector.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(SelectorListener listener)
Add a selector listener.
|
void |
removeListener(SelectorListener listener)
Remove a selector listener.
|
void |
setClickableArea(Rectangle area)
Set clickable area (where selection can be performed on screen).
|
void |
setClickableArea(Viewer viewer)
Set clickable area (where selection can be performed on screen).
|
void |
setClickSelection(int click)
Set the mouse click selection value.
|
void |
setSelectionColor(ColorRgba color)
Set the selection color.
|
addFeature, addFeatureAndGet, addFeatures, clearCache, getFeature, getFeatures, getFeaturesType, getMedia, hasFeature, isPrepared, prepareFeatures
public void addListener(SelectorListener listener)
listener
- The selector listener reference.public void removeListener(SelectorListener listener)
listener
- The selector listener reference.public void setSelectionColor(ColorRgba color)
color
- The selection color.public void setClickSelection(int click)
SelectorConfigurer
setClickSelection
in interface SelectorConfigurer
click
- The click number.InputDevicePointer
public void setClickableArea(Rectangle area)
SelectorConfigurer
setClickableArea
in interface SelectorConfigurer
area
- The representation of the clickable area.public void setClickableArea(Viewer viewer)
SelectorConfigurer
setClickableArea
in interface SelectorConfigurer
viewer
- The viewer reference.Copyright © 2016 Byron 3D Games Studio. All rights reserved.