{"id":17788866,"url":"https://github.com/moebiussurfing/ofxsurfingdebugvariables","last_synced_at":"2025-04-02T00:44:15.894Z","repository":{"id":109378834,"uuid":"368724629","full_name":"moebiussurfing/ofxSurfingDebugVariables","owner":"moebiussurfing","description":"openFrameworks add-on to subscribe, debug and print variables during runtime without any required update","archived":false,"fork":false,"pushed_at":"2021-09-17T08:28:45.000Z","size":3208,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-07T16:19:55.440Z","etag":null,"topics":["openframeworks","openframeworks-addon"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moebiussurfing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-19T02:42:32.000Z","updated_at":"2021-09-17T08:28:47.000Z","dependencies_parsed_at":"2023-03-12T04:00:20.105Z","dependency_job_id":null,"html_url":"https://github.com/moebiussurfing/ofxSurfingDebugVariables","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moebiussurfing%2FofxSurfingDebugVariables","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moebiussurfing%2FofxSurfingDebugVariables/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moebiussurfing%2FofxSurfingDebugVariables/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moebiussurfing%2FofxSurfingDebugVariables/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moebiussurfing","download_url":"https://codeload.github.com/moebiussurfing/ofxSurfingDebugVariables/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246735350,"owners_count":20825223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["openframeworks","openframeworks-addon"],"created_at":"2024-10-27T10:24:25.541Z","updated_at":"2025-04-02T00:44:15.868Z","avatar_url":"https://github.com/moebiussurfing.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ofxSurfingDebugVariables\n\nAn **openFrameworks** add-on to subscribe, debug and print some variables of your **ofApp** during runtime without any required updating.\n \nBased in the original add-on: https://github.com/tettou771/ofxHelpMessage from [**Toru Takata**](https://github.com/tettou771)  \n\nYou can add variables and text or hardcoded messages.  \n\nAdded variables (string, float, int, bool) are referenced, and their value can be shown in real-time in any frame at the same text box.  \nYou don't need to update anything.\n\n## NOTE ABOUT MULTIPLE INSTANCES  \nThe class uses a *singleton*, so you can add referenced variables (or text) from any of your included classes.  \nYou just need to add this header to your classes.  \nWhen using multiple instances, all classes will \"share\" the same text box.\n\n## Screencast\n![Screencast](readme_images/ofxSurfingDebugVariables.gif?raw=true \"moebiusSurfing\")\n\n## Usage\n1. Include `ofxSurfingDebugVariables.h`. In multiple clasess, if desired.\n2. Put the static methods like `ofxSurfingDebugVariables::addText(\"Key S: save\");` in ```setup()```.\n3. During runtime press '?' key to show the text box.\n4. Box position can be dragged by mouse. Will restore the position on restart your app.\n5. Done! All your added variables will be printed on the screen on every frame.\n\n### ofApp.h\n```cpp\n#include \"ofxSurfingDebugVariables.h\"\n\nstring st1;\nfloat f1;\nint i1;\nbool b1;\nofParameter\u003cfloat\u003e floatParam;\nofParameter\u003cint\u003e intParam;\n```\n\n### ofApp.cpp\n```cpp \n\nvoid ofApp::setup()\n{\n    // set the tittle\n    ofxSurfingDebugVariables::setTitle(\"APP INFO\");\n\n    // add/subscribe the variables to be monitorized:\n\n    // hardcoded string text. no name required. not a variable \n    ofxSurfingDebugVariables::addText(\"KEY [SPACE]: HIDE/SHOW\");//not required name on text type\n\n    // pass all variables as reference\n    ofxSurfingDebugVariables::addString(\"myString1\", \u0026str1);\n    ofxSurfingDebugVariables::addFloat(\"myFloat1 \", \u0026f1);\n    ofxSurfingDebugVariables::addInt(\"myInt1\", \u0026i1);\n    ofxSurfingDebugVariables::addBool(\"myBool1\", \u0026b1);\n\n    // add empty line to make space\n    //ofxSurfingDebugVariables::addNewLine();\n    \n    // ofParameters. only float and int types for now.\n    ofxSurfingDebugVariables::addParamFloat(floatParam);\n    ofxSurfingDebugVariables::addParamInt(intParam);\n\n    //--\n\n    // control:\n    // change show key\n    //ofxSurfingDebugVariables::setHelpKey('d');// '?' by default\n    //ofxSurfingDebugVariables::setMomentary(true);// show only when key pressed\n\n    //--\n\n    // customize style:\n    // show\n    //ofxSurfingDebugVariables::setVisible(true);\n    // round box\n    //ofxSurfingDebugVariables::setRounded(true, 5.0f);\n    // set margin borders\n    //ofxSurfingDebugVariables::setMarginBorders(20);\n    // tab label names and variable values aligned by columns\n    //ofxSurfingDebugVariables::setTabbed(true, 1);\n}\n```\n\nYou can use this \"workaround\" to add other **ofParameters** types as pointers too: (float and int are implemented)\n```cpp \nofParameter\u003cfloat\u003e floatParam;\nofxSurfingDebugVariables::addFloat(floatParam.getName(), (float*)\u0026floatParam.get()); // get the name from the parameter\n\nofParameter\u003cstring\u003e stringParam;\nofxSurfingDebugVariables::addString(\"myString\", (string*)\u0026stringParam.get()); // put your custom name\n```\n\n## Dependencies\n* [ofxScaleDragRect](https://github.com/moebiussurfing/ofxScaleDragRect)\n\n## Tested System\n  - **Windows 10** / **VS 2017** / **OF ~0.11**\n  - **macOS**. **High Sierra** / **Xcode9** \u0026 **Xcode10** / **OF ~0.11**\n\n## More Customization\nYou can use some extra methods to change appearance and behavior.\nFor example.\n\n```.cpp\n// clear message\n//ofxSurfingDebugVariables::clear();\n\n// set text color\n// default: ofColor::white\nofxSurfingDebugVariables::setTextColor(ofColor(255, 255, 0));\n\n// set background color\n// default: ofColor(0, 0, 0, 150) this is black transparently\nofxSurfingDebugVariables::setBackgroundColor(ofColor(0));\n\n// set font\n// draw with ofTrueTypeFont if loaded\nofxSurfingDebugVariables::loadFont(\"arial.ttf\", 30);\n\n// set position\n// default: (10, 10)\nofxSurfingDebugVariables::setPos(500, 500);\n\n```\n\n## TODO:\n+ Add more ofParameter types: colors, ofParameterGroup, etc.\n+ Allow multiple boxes when using multi instances, or just split to another add-on without singleton.\n+ Allow add variables/messages on runtime, not just on setup.\n \n## Fork author\nAn add-on by **@moebiusSurfing**  \n*( ManuMolina ) 2019-2021* \n\n## Original Author\n**Toru Takata** in Japan. [GitHub](https://github.com/tettou771) [Website Link](http://tettou771.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoebiussurfing%2Fofxsurfingdebugvariables","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoebiussurfing%2Fofxsurfingdebugvariables","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoebiussurfing%2Fofxsurfingdebugvariables/lists"}