7#include "GuiControllerLayout.h"
13 for(
size_t i = 0; i < spots.size(); i++)
19static GuiControlSpot circle(
int id,
float cx,
float cy,
float d,
const char * label)
24static GuiControlSpot rrect(
int id,
float x,
float y,
float w,
float h,
float radius,
const char * label)
41 l.body.push_back(
GuiBodyPiece{ 52.0f, 46.0f, 296.0f, 128.0f, 60.0f, 0.0f });
42 l.body.push_back(
GuiBodyPiece{ 60.0f, 132.0f, 78.0f, 136.0f, 38.0f, 15.0f });
43 l.body.push_back(
GuiBodyPiece{ 262.0f, 132.0f, 78.0f, 136.0f, 38.0f, -15.0f });
46 l.spots.push_back(rrect(INPUT_TRIGGER_ZL, 62.0f, 6.0f, 92.0f, 24.0f, 12.0f,
"ZL"));
47 l.spots.push_back(rrect(INPUT_TRIGGER_L, 52.0f, 30.0f, 104.0f, 22.0f, 11.0f,
"L"));
48 l.spots.push_back(rrect(INPUT_TRIGGER_ZR, 246.0f, 6.0f, 92.0f, 24.0f, 12.0f,
"ZR"));
49 l.spots.push_back(rrect(INPUT_TRIGGER_R, 244.0f, 30.0f, 104.0f, 22.0f, 11.0f,
"R"));
52 l.spots.push_back(circle(INPUT_BTN_MINUS, 168.0f, 74.0f, 17.0f,
"-"));
53 l.spots.push_back(circle(INPUT_BTN_PLUS, 232.0f, 74.0f, 17.0f,
"+"));
54 l.spots.push_back(rrect(GUI_CTL_CAPTURE, 170.0f, 98.0f, 16.0f, 16.0f, 3.0f,
nullptr));
55 l.spots.push_back(circle(INPUT_BTN_HOME, 222.0f, 106.0f, 17.0f,
nullptr));
58 l.spots.push_back(stick(INPUT_THUMB_L, 112.0f, 100.0f, 66.0f));
59 l.spots.push_back(stick(INPUT_THUMB_R, 252.0f, 152.0f, 66.0f));
62 l.spots.push_back(rrect(0, 140.0f, 140.0f, 20.0f, 20.0f, 3.0f,
nullptr));
63 l.spots.push_back(rrect(INPUT_BTN_UP, 140.0f, 118.0f, 20.0f, 25.0f, 4.0f,
nullptr));
64 l.spots.push_back(rrect(INPUT_BTN_DOWN, 140.0f, 157.0f, 20.0f, 25.0f, 4.0f,
nullptr));
65 l.spots.push_back(rrect(INPUT_BTN_LEFT, 118.0f, 140.0f, 25.0f, 20.0f, 4.0f,
nullptr));
66 l.spots.push_back(rrect(INPUT_BTN_RIGHT, 157.0f, 140.0f, 25.0f, 20.0f, 4.0f,
nullptr));
69 l.spots.push_back(circle(INPUT_BTN_X, 294.0f, 66.0f, 28.0f,
"X"));
70 l.spots.push_back(circle(INPUT_BTN_Y, 266.0f, 94.0f, 28.0f,
"Y"));
71 l.spots.push_back(circle(INPUT_BTN_A, 322.0f, 94.0f, 28.0f,
"A"));
72 l.spots.push_back(circle(INPUT_BTN_B, 294.0f, 122.0f, 28.0f,
"B"));
const GuiControllerLayout & GuiProControllerLayout()
A Pro-style gamepad: two sticks, D-pad, ABXY, L/R/ZL/ZR, plus, minus, home and capture (Switch Pro,...
@ ROUNDRECT
A rounded rectangle: bumpers, triggers, D-pad arms, small square buttons.
@ STICK
An analog stick: an outer ring with a cap that can move.
One rounded rectangle of the silhouette (the pieces are merged into one outline).
One control on a controller drawing.
A controller: its drawing size, silhouette and controls.
const GuiControlSpot * find(int id) const
Finds a control by id (null if the layout has none)