LogoLogo
  • Hello!
  • The Device
    • Device basics
    • Plugging in a module
  • APP
    • Downloading the app
    • Before you start
    • Connecting to The Device
    • Setting a module
    • Using the IMU
    • Logging in / account
    • Checking battery power
    • Renaming the Device
    • Updating the firmware
    • Beacon
  • STARTER PROJECTS
    • Interactive Lighting
    • Touch-Free Music Remote
    • Air Quality Monitor
  • Equations
    • Getting started with equations
    • Equation logic
    • Inputs
    • Outputs
      • Keyboard mode
      • Glow Output & Lighting
        • Fade
        • Dot
        • Arc
        • Rainbow
        • Glitter
      • Cloud Output
    • Sequences
    • Casting an equation
    • Editing & deleting equations
    • Removing an equation
  • API
    • Languages
      • Javascript
      • Python CSV
    • Platforms
      • Unity
        • Windows
        • MacOS
      • TouchDesigner
      • Unreal Engine
    • Streaming
  • Modes
    • Beacon
  • Modules
    • Button
    • Color
    • Dial
    • Digital
    • Distance
    • Environment
    • Flex
    • Force
    • Gesture
    • Glow
    • Joystick
    • Light
    • Motion
    • Move
    • Proximity
    • Slider
    • Sound
    • Spin
    • Thermal
    • Tone
  • Algorithms
    • Orientation
Powered by GitBook
On this page
  • Properties
  • Code
  1. Modules

Gesture

Measures the direction of movement of an object above it.

PreviousForceNextGlow

Last updated 6 months ago

Same module as proximity

NOTE: Only one gesture module can be used at a time

WARNING: Cannot be used at the same time as the color module

Properties

Name
Data Type
Range

Direction

enum

NONE, LEFT, RIGHT, UP, DOWN

Raw

int

0, 1 (Up), 2 (Down), 3 (Left), 4 (Right), 5 (Near), 6 (Far)

What does the data mean?

Swipe your hand or an object above the module and it will measure the direction of movement. Directions are based on the orientation of the device. If the power switch on the device is the bottom then a direction of LEFT is a swipe from the right side to the left side of the device.

What ports can I use it on?

3-6

Code

var swipe = Magic.modules.gesture.direction;
using Magic;

public class Demo : MonoBehaviour
{
    // create a reference to the module
    public Magic.Modules.GestureModule gesture;
    
    void Start()
    {
    }
    
    void Update()
    {
        // access the property of the module
        Magic.Modules.GestureModule.GestureDirection swipe = gesture.direction;
    }
}