ArduinoDumbDisplay v0.9.9-r34
DumbDisplay Arduino Library -- https://github.com/trevorwslee/Arduino-DumbDisplay
 
Loading...
Searching...
No Matches
JoystickDDLayer Class Reference

Class for virtual joystick layer; created with DumbDisplay::createJoystickLayer() More...

#include <dumbdisplay.h>

Inheritance diagram for JoystickDDLayer:
DDLayer DDObject

Public Member Functions

 JoystickDDLayer (int8_t layerId)
 for internal use only

 
void autoRecenter (bool autoRecenter=true)
 
void colors (const String &stickColor, const String &stickOutlineColor, const String &socketColor="", const String &socketOutlineColor="")
 set the colors of the stick UI
 
void moveToPos (int16_t x, int16_t y, bool sendFeedback=false)
 
void moveToCenter (bool sendFeedback=false)
 
void valueRange (int16_t minValue, int16_t maxValue, int valueStep=1, bool sendFeedback=false)
 
void snappy (bool snappy=true)
 set 'snappy' makes stick snaps to closest value when moved
 
void showValue (bool show=true, const String &color="")
 show value on top of the stick
 
- Public Member Functions inherited from DDLayer
void border (float size, const String &color, const String &shape="flat", float extraSize=0)
 
void noBorder ()
 
void padding (float size)
 
void padding (float left, float top, float right, float bottom)
 
void noPadding ()
 
void margin (float size)
 
void margin (float left, float top, float right, float bottom)
 
void noMargin ()
 
void backgroundColor (const String &color, int opacity=100)
 
void noBackgroundColor ()
 
void visible (bool visible)
 
void transparent (bool transparent)
 
void disabled (bool disabled=true)
 
void opacity (int opacity)
 
void alpha (int alpha)
 
void blend (const String &color, int alpha=255, const String &mode="darken")
 
void noblend ()
 
void clear ()
 clear the layer
 
void flash ()
 normally used for "feedback" – flash the default way (layer + border)
 
void flashArea (int x, int y)
 normally used for "feedback" – flash the area (x, y) where the layer is clicked
 
void explicitFeedback (int16_t x=0, int16_t y=0, const String &text="", DDFeedbackType type=CLICK, const String &option="")
 
const String & getLayerId () const
 
void setFeedbackHandler (DDFeedbackHandler handler, const String &autoFeedbackMethod="", const String &allowFeedbackTypes="")
 
void enableFeedback (const String &autoFeedbackMethod="", const String &allowFeedbackTypes="")
 
void disableFeedback ()
 disable "feedback"
 
const DDFeedbackgetFeedback ()
 
void debugOnly (int i)
 for debug use
 
DDFeedbackManager * getFeedbackManager () const
 
DDFeedbackHandler getFeedbackHandler () const
 

Additional Inherited Members

- Public Attributes inherited from DDObject
int8_t objectType
 object type – DD_OBJECT_TYPE_LAYER or DD_OBJECT_TYPE_TUNNEL
 
String customData
 custom data
 
- Protected Member Functions inherited from DDLayer
 DDLayer (int8_t layerId)
 
void _enableFeedback ()
 
- Protected Attributes inherited from DDLayer
String layerId
 
DDFeedbackManager * pFeedbackManager
 
DDFeedbackHandler feedbackHandler
 

Detailed Description

Class for virtual joystick layer; created with DumbDisplay::createJoystickLayer()

Since
v0.9.7-r2

Member Function Documentation

◆ autoRecenter()

void JoystickDDLayer::autoRecenter ( bool  autoRecenter = true)

set joystick auto-recenter on / off; if auto recenter, after user releases the joystick, the joystick will move back to the center position automatically note that it will not affect the current position; use moveToCenter() to move to the center

◆ moveToCenter()

void JoystickDDLayer::moveToCenter ( bool  sendFeedback = false)

move joystick to the center

Parameters
sendFeedbackif true, will send "feedback" for the move (regardless of the current position)

◆ moveToPos()

void JoystickDDLayer::moveToPos ( int16_t  x,
int16_t  y,
bool  sendFeedback = false 
)

move joystick position (if joystick is single directional, will only move in the movable direction)

Parameters
xx to move to
xy to move to
sendFeedbackif true, will send "feedback" for the move (regardless of the current position)

◆ valueRange()

void JoystickDDLayer::valueRange ( int16_t  minValue,
int16_t  maxValue,
int  valueStep = 1,
bool  sendFeedback = false 
)

set stick max value; will also move the joystick position to "home" – center if auto-recenter else (0, 0)

Parameters
minValuethe min value of the stick
maxValuethe max value of the stick
sendFeedbackif true, will send "feedback" for the move (regardless of the current position)