API Documentation
Loading...
Searching...
No Matches
Joystick Class Reference

#include <Joystick.h>

Inheritance diagram for Joystick:
[legend]
Collaboration diagram for Joystick:
[legend]

Signals

void joystickLocationChangedSignal (const Vector< 2, fltp04 > &location)
 
void joystickButtonPressedSignal (const Vector< 2, fltp04 > &location)
 
void joystickButtonReleasedSignal (const Vector< 2, fltp04 > &location)
 

Public Member Functions

 Joystick (QWidget *parent=nullptr)
 
Vector< 2, fltp04centerPoint () const
 
Vector< 2, fltp04knobLocation () const
 
fltp04 knobRadius () const
 
fltp04 outerRadius () const
 
QSize sizeHint () const override
 
void setKnobColor (RGBColor inner, RGBColor outer)
 
void setBackgroundColor (RGBColor inner, RGBColor outer)
 
float snapBackPercent () const
 
void setSnapBackPercent (float snap_percent)
 
virtual void mousePressEvent (QMouseEvent *ev) override
 
virtual void mouseMoveEvent (QMouseEvent *ev) override
 
virtual void mouseReleaseEvent (QMouseEvent *ev) override
 
void addButton (Button *button)
 
bool event (QEvent *event) override
 
void setDeadzone (fltp08 deadzone)
 
void setJoystickSettingsName (const String &name)
 
const JoystickSettingssettings () const
 
void setValue (const Vector< 2, fltp04 > &location)
 
bool isDragging () const
 
void setSettings (const JoystickSettings &mode)
 
void setDrawDeadzone (bool draw_deadzone)
 
void setDrawSensitivity (bool draw_sense)
 
QRect arrowRect (const Vector< 2, sint04 > &location, const Vector< 2, fltp04 > &center_point, fltp04 radius) const
 

Protected Member Functions

void showSettings (const PopupInfo &info)
 
void updateButton (uint04 button)
 
void updateButtons ()
 
Vector< 2, fltp04convertLocationToSignal (Vector< 2, fltp04 > mouse_location)
 
void resizeEvent (QResizeEvent *event) override
 
void paintEvent (QPaintEvent *paint_event) override
 

Protected Attributes

JoystickSettings m_settings
 
Buttonm_settings_button
 
Vector< 2, fltp04m_location
 
fltp04 m_inner_radius
 
RGBColor m_outer_color
 
RGBColor m_inner_color
 
Buffer< Button * > m_custom_buttons
 
RGBColor m_knob_inner_color
 
RGBColor m_knob_outer_color
 
Vector< 2, fltp04m_joystick_draw_location
 
fltp04 m_snap_back_percent = 0.0f
 
QPropertyAnimation * m_joystick_release_animation
 
fltp04 m_knob_radius
 
bool m_dragging
 
bool m_is_pressing
 
bool m_draw_deadzone
 
bool m_draw_sensitivity
 

Properties

float snap_back_percent
 

Constructor & Destructor Documentation

◆ Joystick()

Joystick ( QWidget * parent = nullptr)
explicit

Member Function Documentation

◆ addButton()

void addButton ( Button * button)

◆ arrowRect()

QRect arrowRect ( const Vector< 2, sint04 > & location,
const Vector< 2, fltp04 > & center_point,
fltp04 radius ) const

◆ centerPoint()

Vector< 2, fltp04 > centerPoint ( ) const

◆ convertLocationToSignal()

Vector< 2, fltp04 > convertLocationToSignal ( Vector< 2, fltp04 > mouse_location)
protected

◆ event()

bool event ( QEvent * event)
override

◆ isDragging()

bool isDragging ( ) const

◆ joystickButtonPressedSignal

void joystickButtonPressedSignal ( const Vector< 2, fltp04 > & location)
signal

◆ joystickButtonReleasedSignal

void joystickButtonReleasedSignal ( const Vector< 2, fltp04 > & location)
signal

◆ joystickLocationChangedSignal

void joystickLocationChangedSignal ( const Vector< 2, fltp04 > & location)
signal

◆ knobLocation()

Vector< 2, fltp04 > knobLocation ( ) const

◆ knobRadius()

fltp04 knobRadius ( ) const

◆ mouseMoveEvent()

void mouseMoveEvent ( QMouseEvent * ev)
overridevirtual

◆ mousePressEvent()

void mousePressEvent ( QMouseEvent * ev)
overridevirtual

◆ mouseReleaseEvent()

void mouseReleaseEvent ( QMouseEvent * ev)
overridevirtual

◆ outerRadius()

fltp04 outerRadius ( ) const

◆ paintEvent()

void paintEvent ( QPaintEvent * paint_event)
overrideprotected

◆ resizeEvent()

void resizeEvent ( QResizeEvent * event)
overrideprotected

◆ setBackgroundColor()

void setBackgroundColor ( RGBColor inner,
RGBColor outer )

◆ setDeadzone()

void setDeadzone ( fltp08 deadzone)

◆ setDrawDeadzone()

void setDrawDeadzone ( bool draw_deadzone)

◆ setDrawSensitivity()

void setDrawSensitivity ( bool draw_sense)

◆ setJoystickSettingsName()

void setJoystickSettingsName ( const String & name)

◆ setKnobColor()

void setKnobColor ( RGBColor inner,
RGBColor outer )

◆ setSettings()

void setSettings ( const JoystickSettings & mode)

◆ setSnapBackPercent()

void setSnapBackPercent ( float snap_percent)

◆ settings()

const JoystickSettings & settings ( ) const
inline

◆ setValue()

void setValue ( const Vector< 2, fltp04 > & location)

◆ showSettings()

void showSettings ( const PopupInfo & info)
protected

◆ sizeHint()

QSize sizeHint ( ) const
override

◆ snapBackPercent()

float snapBackPercent ( ) const
inline

◆ updateButton()

void updateButton ( uint04 button)
protected

◆ updateButtons()

void updateButtons ( )
protected

Member Data Documentation

◆ m_custom_buttons

Buffer<Button*> m_custom_buttons
protected

◆ m_dragging

bool m_dragging
protected

◆ m_draw_deadzone

bool m_draw_deadzone
protected

◆ m_draw_sensitivity

bool m_draw_sensitivity
protected

◆ m_inner_color

RGBColor m_inner_color
protected

◆ m_inner_radius

fltp04 m_inner_radius
protected

◆ m_is_pressing

bool m_is_pressing
protected

◆ m_joystick_draw_location

Vector<2, fltp04> m_joystick_draw_location
protected

◆ m_joystick_release_animation

QPropertyAnimation* m_joystick_release_animation
protected

◆ m_knob_inner_color

RGBColor m_knob_inner_color
protected

◆ m_knob_outer_color

RGBColor m_knob_outer_color
protected

◆ m_knob_radius

fltp04 m_knob_radius
protected

◆ m_location

Vector<2, fltp04> m_location
protected

◆ m_outer_color

RGBColor m_outer_color
protected

◆ m_settings

JoystickSettings m_settings
protected

◆ m_settings_button

Button* m_settings_button
protected

◆ m_snap_back_percent

fltp04 m_snap_back_percent = 0.0f
protected

Property Documentation

◆ snap_back_percent

float snap_back_percent
readwrite

The documentation for this class was generated from the following files: