ofxVui » View + GUI System addon. Much Easy! Such Wow!


#1

I made my first addon! :tada::beer:
So I know there’s a lot of GUI stuff out there but I think you guys should take this one for a test drive! ofxVui is inspired by my experience with Flash and Front-end web dev. I wanted to bring that experience into openFrameworks and create a simple way for us to design/style screens, interactive elements, and trigger animations. I hope you guys will find this as useful as I do!

ofxVui has:
• Mouse/Touch events that respect Element render order
• Element styling like CSS (borders, backgroundImage, anchorPoints, etc)
• Element styling per state: UP, OVER, DOWN
• One line animation calls/syntax like TweenMax - Animate(Float time, String params)
• Mouse/Touch events that still work when View is scaled/rotated
:pizza:

Checkout the GitHub repo for more info and code examples! Take it for a spin and let me know what you think! :slight_smile:



Watch Examples Video, it shows:
• Animation
• Events
• View Manager
• Element Styling
(jump around in the timeline, some parts might take awhile.)


#2

Congratulations! It looks very nice in the video! :slight_smile: I remember enjoying DisplayObject and the events in AS3 :slight_smile:

Some things that come to mind when looking at the source code:

I see new and pointers being used a lot, but nowhere where the memory is freed. Wouldn’t it be safer memorywise to get rid of all new calls? Instead of

Text* animationA;
animationA = new Text( 20, Y+=40, ss, ".button" );

something like

Text animationA;
animationA.init( 20, Y+=40, ss, ".button" );

?

Formatting: the code seems to have random indentation when seen in GitHub: https://github.com/pixelsandcandy/ofxVui/blob/master/src/ofxVui.h which makes it harder to read. The automatic formatting of the editor can make it look beautiful. Does XCode have such a feature? I use QtCreator and AStyle, which can be configured to look exactly as you like (where brackets should be, where should spaces be added or removed, etc).

Great work! Thanks for sharing! :slight_smile:


#3

@hamoid - Thanks! Yea as I mentioned in the repo/README cleaning up the code is def on my todo list. I’ll also go back and get rid of pointers, I just got used to pointers when I first started using C++ because I had some issues with making things work. I’ve recently been moving away from using pointers and so will try to refactor ofxVui and remove pointers.

Also, for some of the indentations stuff, I’m switching/writing code in Xcode and Visual Studio 2017, which sometimes screws up the indentation even though it looks fine when I’m writing it - but will be mindful of indentation once I clean everything up. Thanks for the feedback!