Class RendererUI
Renderer for the UI.
Basically draws the overlay for the currently selected tool over the particles
and forwards the current tool input to the corresponding handler.
Inheritance
object
RendererUI
Assembly: .dll
Syntax
Constructors
|
Edit this page
View Source
Declaration
public RendererUI(AmoebotSimulator sim, InputController inputController)
Parameters
Fields
|
Edit this page
View Source
Declaration
private bool addToolObjectSelected
Field Value
|
Edit this page
View Source
Declaration
private IObjectInfo addToolSelectedObject
Field Value
|
Edit this page
View Source
currentlyDragging
Declaration
private bool currentlyDragging
Field Value
|
Edit this page
View Source
Declaration
private InputManager input
Field Value
|
Edit this page
View Source
Declaration
private InputController inputController
Field Value
|
Edit this page
View Source
material_hexagonAddObjectOverlay
Declaration
public Material material_hexagonAddObjectOverlay
Field Value
Type |
Description |
Material |
|
|
Edit this page
View Source
material_hexagonAddOverlay
Declaration
public Material material_hexagonAddOverlay
Field Value
Type |
Description |
Material |
|
|
Edit this page
View Source
material_hexagonMoveOverlay
Declaration
public Material material_hexagonMoveOverlay
Field Value
Type |
Description |
Material |
|
|
Edit this page
View Source
material_hexagonMoveSelectionOverlay
Declaration
public Material material_hexagonMoveSelectionOverlay
Field Value
Type |
Description |
Material |
|
|
Edit this page
View Source
material_hexagonRemoveOverlay
Declaration
public Material material_hexagonRemoveOverlay
Field Value
Type |
Description |
Material |
|
|
Edit this page
View Source
material_hexagonSelectionOverlay
Declaration
public Material material_hexagonSelectionOverlay
Field Value
Type |
Description |
Material |
|
|
Edit this page
View Source
material_objectSelectionOverlay
Declaration
public Material material_objectSelectionOverlay
Field Value
Type |
Description |
Material |
|
|
Edit this page
View Source
mesh_baseHexagonBackground
Declaration
public Mesh mesh_baseHexagonBackground
Field Value
|
Edit this page
View Source
Declaration
private Vector2Int moveToolObjectOffset
Field Value
Type |
Description |
Vector2Int |
|
|
Edit this page
View Source
Declaration
private bool moveToolObjectSelected
Field Value
|
Edit this page
View Source
moveToolParticlePosition
Declaration
private Vector2Int moveToolParticlePosition
Field Value
Type |
Description |
Vector2Int |
|
|
Edit this page
View Source
moveToolParticleSelected
Declaration
private bool moveToolParticleSelected
Field Value
|
Edit this page
View Source
Declaration
private IObjectInfo moveToolSelectedObject
Field Value
|
Edit this page
View Source
pSetDragHandler
Declaration
private PSetDragHandler pSetDragHandler
Field Value
|
Edit this page
View Source
sim
Declaration
private AmoebotSimulator sim
Field Value
Methods
|
Edit this page
View Source
ClickActionCallback(ClickAction)
Called when a click or a drag (also ongoing drag) is executed.
Handles all the actions that should be executed when this happens
(e.g., selecting a particle, adding a particle etc.).
Declaration
public void ClickActionCallback(ClickAction action)
Parameters
Type |
Name |
Description |
ClickAction |
action |
The click or drag action that occurred.
|
|
Edit this page
View Source
Render(ViewType)
The render loop of the renderer.
Here the mostly hexagonal overlays are drawn based on the current
state of the renderer UI and the current mouse position.
Declaration
public void Render(ViewType viewType)
Parameters
Type |
Name |
Description |
ViewType |
viewType |
The current view type used to
visualize the particle system.
|
|
Edit this page
View Source
ResetSelection()
Resets the current selection state. This should be
called whenever the system is regenerated in Init Mode.
Declaration
public void ResetSelection()
|
Edit this page
View Source
TryMoveObject(IObjectInfo, Vector2Int)
Declaration
private bool TryMoveObject(IObjectInfo obj, Vector2Int newPos)
Parameters
Type |
Name |
Description |
IObjectInfo |
obj |
|
Vector2Int |
newPos |
|
Returns
|
Edit this page
View Source
TryRemoveObject(IObjectInfo, Vector2Int, bool)
Tries to remove the given position from the given object.
Should be called by the Remove tool.
If the object only consists of the given position, the
object is removed from the object completely.
Declaration
private void TryRemoveObject(IObjectInfo obj, Vector2Int position, bool showWarning = false)
Parameters
Type |
Name |
Description |
IObjectInfo |
obj |
The object under the cursor.
|
Vector2Int |
position |
The position to be removed.
|
bool |
showWarning |
Whether a warning message should be
displayed when the part of the object cannot be removed.
|
|
Edit this page
View Source
TryRemoveParticle(IParticleState)
Tries to remove the given particle from the system.
Should be called by the Remove tool.
Declaration
private void TryRemoveParticle(IParticleState particle)
Parameters
Type |
Name |
Description |
IParticleState |
particle |
The particle to be removed.
|