Giter Site home page Giter Site logo

ofxtouchgui's Introduction

https://github.com/trentbrooks/ofxTouchGUI/raw/master/screenshot1.jpg

ofxTouchGUI

Openframeworks addon (tested with 0073 and 0074 ios and osx). It's basically just another GUI, but geared more towards remote controlling stuff from iPhone or iPad through OSC (works with desktop). Also allows to save fixed variables, listen to events, save to XML, and reset GUI values.

It's kind of like Memo's ofxSimpleGuiToo and the Processing library controlP5, but with OSC control and underwhelming gradient fills. It's also handy for creating inidividual UI elements on their own, eg. image buttons for different screens.

Includes slider, dropdown list, button/image button, toggle button, text/title fields, input text (ios only atm), and general variables. All items can be custom positioned/sized on creation. Colours, fonts, etc can be changed. Settings can be saved to XML. Values can be sent via OSC.

Ubuntu and windows user's will need to rename the file's from .mm to .cpp.

Sample usage

// setup
ofxTouchGUI settings;
settings.loadSettings("tg_settings.xml");

// add a slider (auto positioned)
settings.addSlider("SLIDER X", &someValue, 0.0f, 1.0f); // label, value, min, max
// or custom position and size
settings.addSlider("SLIDER X", &someValue, 0.0f, 1.0f, 20, 115, 200, 35); // label, value, min, max

// add an image button with event listener
ofxTouchGUIButton* imageBtn = settings.addButton("MY IMAGE BUTTON", 225, 75, 74, 35); // label, value, x, y, width, height
imageBtn->loadImageStates("play-up.png", "play-down.png"); // touch down and up images
ofAddListener(imageBtn->onChangedEvent, this, &testApp::onImageButtonPressed); // bind a function in testApp to the element

// enable osc
settings.setupSendOSC("127.0.0.1", 4444);

// add variables or constants (not for display, good for configs, etc.)
settings.setConstant("myConstant", &someConstant);
settings.setVariable("myVar", &someVar);

// or add variables for display
settings.addVarText("Mouse X", &mouseX); 
settings.addVarText("Mouse Y", &mouseY);

See example files for more detailed code samples.

Openframeworks addons required

  • ofxXmlSettings & ofxOsc (in addons folder)

-Trent Brooks

ofxtouchgui's People

Contributors

trentbrooks avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.