Esp32-RBGridUI
Library for creating UIs for the RBController app
Loading...
Searching...
No Matches
joystick.h
Go to the documentation of this file.
1#pragma once
2
3#include "widget.h"
4
5namespace gridui {
6
9class Joystick : public Widget {
10 template <typename Self, typename Finished>
12
13 using Widget::Widget;
14
15public:
16 void setColor(const std::string& color) {
17 m_state->set("color", new rbjson::String(color));
18 }
19
20 std::string color() const {
21 return data().getString("color");
22 }
23
24 void setKeys(const std::string& keys) {
25 m_state->set("keys", new rbjson::String(keys));
26 }
27
28 std::string keys() const {
29 return data().getString("keys");
30 }
31
32 void setText(const std::string& text) {
33 m_state->set("text", new rbjson::String(text));
34 }
35
36 std::string text() const {
37 return data().getString("text");
38 }
39
40 int32_t x() const {
41 return data().getInt("jx");
42 }
43
44 int32_t y() const {
45 return data().getInt("jy");
46 }
47};
48
49};
void setKeys(const std::string &keys)
Definition joystick.h:24
std::string keys() const
Definition joystick.h:28
std::string text() const
Definition joystick.h:36
int32_t x() const
Definition joystick.h:40
void setText(const std::string &text)
Definition joystick.h:32
std::string color() const
Definition joystick.h:20
int32_t y() const
Definition joystick.h:44
void setColor(const std::string &color)
Definition joystick.h:16
bool set(const std::string &key, rbjson::Value *value)
Definition widget.cpp:27
WidgetState * m_state
Definition widget.h:265
const rbjson::Object & data() const
Definition widget.h:263
Definition arm.h:8