HEADS UP!
v0.9-beta-23: OpenGUI now supports dynamic content scaling. Details in the wiki
v0.9-beta-19: A new “size” parameter on the OGFont class will require you to update your fonts. Details in the wiki
v0.9-beta-12: Improvements to widget selection in edit mode. You can now shift click to select multiple widgets. Selection is now also dependent on the draw order rather than z position.
Participate
Any help, including feature requests and error reports, is much appreciated.
I happily add collaborators on GitHub, so don’t be shy.
Disclaimer
Although OpenGUI is being improved upon regularly, it does still have some rough edges. It probably won’t turn your computer into a suicidal toaster, but there are no guarantees.
hi,
i like the open source approach and the demo looks good. When I run the demo in unity everything is like expected in play mode but I can’t see the elements in edit mode. Shouldn’t they be visible?
@dev_peter: It does work in edit mode, it’s just displayed in the game view. Unfortunately the edit view is off limits for OnGUI draw calls. What you can do is accommodate for it with an appropriate layout for GUI editing. This is the one I am using:
ah ok, thats fine! I’ll tried it but couldn’t see anything But I’m sure I did something wrong. Will try it again late. How are you dealing with mobile devices and different screensizes?
All widget types inherit the same master class OGWidget, which has the “stretch” and “anchor” subclasses. With those you can position and resize any widget according to screen size with a “factor” property (for instance, set that to 0.5 and the widget only stretches to half the screen size). There is also a manual offset so you can stretch them to be something like the screen size minus 20 pixels/world units. That is basically all you need to accommodate for multiple screen sizes and ratios.
I updated the original post with a link to a quick API reference i just did. It’s not totally there yet, but it covers the basics.
You can copy text line carriage returns from notepad and they will appear with with carriage returns. This seems to work for text-fields.
Haven’t used any scripting yet to make changes. But should be fun.
Oh wow! I haven’t been back here for a while, I’ve been making updates to the code, but I didn’t think anyone was interested in it. When I am done with the features I think are missing from this (which is not a tremendous amount, but still quite a bit), I should merge it with your C# version.
I’ve been spending some time starting this framework again from scratch (while trying to maintain backward compatibility).
The reason is that I wanted to reduce draw calls and start moving away form the native GUI system and onto the low-level GL library, as OnGUI will inevitably be discarded at some point.
Changes
Atlases (meaning all textures are drawn with the same draw call!)
Complete rewrite, meaning more stability
Custom inspectors to facilitate making skins
To do
Scroll views don’t clip the child objects very well yet.
All text is still truetype, so a draw call each. ( fixed! )
I’m pretty hyped about this, because when I get the bitmap text going, this will essentially be a single drawcall GUI \o/
If anyone wants to help me test this out, the code with example project can be cloned from the GitHub page. It’s in the “testing” folder.
There we go, changed to Creative Commons Attribution 4.0 International I’ll try to keep the 1.0 version backward compatible, but be prepared to make some changes, as there will be a new skinning system and a select few variable deprecations.