7#include "GuiControllerDraw.h"
31 const std::vector<int>&
getHighlight()
const {
return highlighted; }
34 void setLeader(
bool on,
float fromX = 0.0f,
float fromY = 0.0f);
36 void setLit(std::function<
bool(
int)> fn) { lit = fn; }
38 void setStick(
int id,
float x,
float y);
51 void emit(
const GuiMesh& m);
53 const GuiControllerLayout * layout;
55 std::vector<int> highlighted;
57 float leaderX, leaderY;
58 std::function<bool(
int)> lit;
59 std::vector<float> stickX, stickY;
61 std::vector<SpotCache> spots;
62 std::vector<GuiText *> labels;
63 std::vector<bool> labelLit;
66 std::vector<MeshVertex> scratch;
67 float originX, originY;
void setLit(std::function< bool(int)> fn)
Sets which controls are drawn as pressed; asked every frame (null for none)
void setHighlight(int id)
Highlights one control (0 = none)
void setLeader(bool on, float fromX=0.0f, float fromY=0.0f)
Draws a line from a point (design-canvas coordinates, such as a list row's edge) to the first highlig...
void draw() override
Called constantly to redraw the element.
void setLayout(const GuiControllerLayout &layout)
Changes the controller drawn.
GuiControllerView(const GuiControllerLayout &layout, float scale=1.0f)
void setStick(int id, float x, float y)
Sets an analog stick's position (-1 to 1 each)
bool getSpotCentre(int id, float &x, float &y) const
Gets the center of a control in design-canvas coordinates (false if the layout has no such control)
const std::vector< int > & getHighlight() const
Gets the highlighted control ids.
void setScale(float scale)
Changes the size.
Accumulates shapes as a triangle list of MeshVertex.
A controller: its drawing size, silhouette and controls.