Search Unity

Snapshot release of ColdGUI 0.1 for Unity 3.1

Discussion in 'Immediate Mode GUI (IMGUI)' started by soenberg, Nov 12, 2010.

  1. soenberg

    soenberg

    Joined:
    Sep 20, 2010
    Posts:
    18
    [Updated with new version 01.11.2011]
    I have updated ColdGUI to version 0.2.1. This was done to add the sender of an event as the first parameter of the event. This is necessary to identify the sender of the event.

    [Updated with new version 01.10.2011]
    I have updated ColdGUI to version 0.2. A lot of new features and even more bug fixes and optimizations have been introduced in this version. ColdGUI now features editing of GUIStyles directly in the inspector, dynamic data containers, better documentation, more demos and much more. See below for full update details.

    --------------------------------------------------

    Created by:
    Tore Sønberg Madsen
    Apex Virtual Entertainment
    tech@apex.dk

    Last updated 01.11.2011

    Download location: http://www.apex.dk/technology/downloads/ColdGUI_0.2.1.zip

    What is ColdGUI?
    --------------------------------------------------
    ColdGUI is a visual GUI editor for the Unity game engine that allows developers to create GUI hierarchies represented by Unity game object hierarchies and move and resize each individual element directly in the editor.

    Why ColdGUI?
    --------------------------------------------------
    The current Unity GUI system only allow GUI elements to be created through code and therefore only by programmers. By adding an interactive, visual editor, GUI construction can be left to a designer or 2D artist. This cuts down development time as programmers aren't required for each modification or addition to the GUI layout and appearance. Furthermore, ColdGUI allows the developer to see how the GUI will look in the application without having to run it.

    The ColdGUI editor and components are fully integrated into the existing Unity editor and the visual GUI editor window can be used side by side with the existing scene and game views. It uses the built-in Unity GUISkin class to define styles, with alignment, textures and fonts. Finally, a simple event handling interface allows for functionality to be hooked to the ColdGUI components by programmers.

    How does ColdGUI work?
    --------------------------------------------------
    At its core ColdGUI uses the built-in GUI system of Unity to render elements and events (mouse over, keypresses, etc.). ColdGUI uses a single OnGUI() call in the GUIRoot of each separate hierarchy, which allows for fast debugging and performance monitoring.

    The visual editor is controlled using standard Unity types that can be modified at editor time. These are coupled with the Undo controls in Unity which allows the developer to use undo and redo even when working in the visual GUI editor. An additional functionality provided by ColdGUI is the possibility of serializing and de-serializing a GUI hierarchy to an xml file. These xml representations are purely optional and are not required for building GUI using ColdGUI.

    The visual editor can also be used in the editor at run time to update the appearence of the GUI while running the rest of the application at the same time. When modifying the GUI at run time, the changes will be discarded when the application is stopped as per Unity standards.

    Version 0.2.1 features (tested in Unity 3.1.0f4):
    --------------------------------------------------
    - Added sender of event as parameter in all delegates


    Version 0.2 features (tested in Unity 3.1.0f4):
    --------------------------------------------------
    - GUIStyle editing in inspector
    - Support for data containers
    - Focus control
    - Remove Editor dependency in data containers
    - Handle all types in xml deserialization
    - Add borders for NoScale scale mode
    - Fix tile layout
    - Scaling for components reworked
    - Improve performance
    - Various bug fixes

    Additions to demo:
    --------------------------------------------------
    - Demo showing use of GUISkin and GUIStyle
    - Demo showing data containers
    - Demo showing extensions of components and containers

    Additions to manual:
    --------------------------------------------------
    - Documentation of extension of components and containers
    - Documentation of editing GUIStyles in the Unity inspector
    --------------------------------------------------


    Version 0.1 features
    --------------------------------------------------
    - Layout and skinning of basic components
    - Visual editor for drag and resize actions
    - GUISkin support for custom styles
    - Hierarchy of game objects consistent with the GUI hierarchy
    - Undo and redo functions for all actions
    - Xml serialization and de-serialization for GUI hierarchy

    Current components:
    --------------------------------------------------
    - Basic components:
    - Button
    - CheckBox
    - Image
    - Label
    - Slider
    - TextField
    - Containers
    - Group
    - Root
    - SelectionGrid
    - GridItem
    - DataGroup
    - DataSelectionGrid
    - Layouts
    - Basic
    - Horizontal
    - Vertical
    - Tile (both rows and columns)


    If you find any bugs or missing features, let me know in this thread and I will respond as soon as possible.

    Regards,
    Tore Sønberg Madsen
     
    Last edited: Jan 11, 2011
  2. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    How on earth did I miss this thread? This is an -excellent- start. I'm assuming this is your project and not associated with what is promised to appear sometime during 3.x, right?
     
  3. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    I`ve also missed this one. Not the only useful plugin that i`ve lost forever i could swear. New Plugins and other useful resources sink too fast in the rest of the posts ...
     
  4. box01

    box01

    Joined:
    Apr 2, 2009
    Posts:
    62
    WOW, have been waiting for this for ages, Must test it now !!!

    BTW , there should be a bit more screen shots or a website for your products, so people get excited before reading the full text?
     
  5. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Nice thing you started here :)
    Looking forward to see where you are heading to.


    To the comments: have people been in some deep sleep for years or how comes that each thread on this matter is handled as if it was the first although GUIX existed for 2 years, which allows you to work with Unity GUI in good old performant MVC manner? ;)
     
  6. Deleted User

    Deleted User

    Guest

    I'm still wondering why something like this isn't built-in in Unity yet...
    Very nice. Also, is it free? :)
     
  7. Deleted User

    Deleted User

    Guest

    TBH I don't like GUIX for some reason lol. It's cool and such but for some reason I prefer programming gui over using guix :D
     
  8. soenberg

    soenberg

    Joined:
    Sep 20, 2010
    Posts:
    18
    Thanks for the replies guys!

    @bigkahuna: This project is being developed by me as part of my employment at Apex Virtual Entertainment and as such the project is owned by them and not associated with Unity Technologies.

    @box01: Screenshots and a more in-depth website is in the plans, but as a pure programmer I won't trouble you with anything visual that I have created :) The tool is currently being learned and used by our in-house GUI designer/artist for some game projects and I assume that we will post some screenshots of work created with the editor soon. As for the website, a sub-site of the www.apex.dk domain is being created at the moment that will contain this as well as other development tools currently being made by Apex Employees (particularly a xml based scene loader that shows great promise).

    @Mister Edvinas: The reason we are releasing a snapshot at this time, is to show it to the community and get some much appreciated feedback. No pricing option has been discussed internally. Please enjoy the product and let me know if there is anything in particular that should be added or fixed in the tool.

    Thank you again for your comments and let me know if you have more specific questions or comments on the tool or any of its feartures.

    Regards,
    Tore Sønberg Madsen
    Apex Virtual Entertainment
     
  9. tbgBK

    tbgBK

    Joined:
    Nov 18, 2010
    Posts:
    4
    It's possible to customize your tool myself?

    - create own elements
    - expand the element properties

    tbgBK
     
    Last edited: Nov 19, 2010
  10. soenberg

    soenberg

    Joined:
    Sep 20, 2010
    Posts:
    18
    Sorry for the late reply :)

    @tbgBK: It is possible to create your own elements by extending the AGUIComponent or AGUIContainer classes and implementing the virtual and abstract functions. Expanding the element properties can be done the same way or by letting me know if there are som properties you think I have missed and I will add them in the next release.

    Regards,
    Tore Sønberg Madsen
    Apex Virtual Entertainment
     
  11. tbgBK

    tbgBK

    Joined:
    Nov 18, 2010
    Posts:
    4
    hello soenberg,

    i always got following error messages when i wanted build a web application:

    ArgumentException: The Assembly UnityEditor is referenced by ColdGUIAssembly. But the dll is not allowed to be included or could not be found.
    UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache) (at E:/BuildAgent/work/71ca6fec1b41cc30/Editor/Mono/AssemblyHelper.cs:52)
    UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache) (at E:/BuildAgent/work/71ca6fec1b41cc30/Editor/Mono/AssemblyHelper.cs:55)
    UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch) (at E:/BuildAgent/work/71ca6fec1b41cc30/Editor/Mono/AssemblyHelper.cs:86)
    UnityEditor.HostView:OnGUI()

    --------------------------------------------------------------------------------------------------------------------------------------------------------

    Error building Player: Extracting referenced dlls failed.
    UnityEditor.HostView:OnGUI()


    You already know this error?

    tbgBK
     
  12. soenberg

    soenberg

    Joined:
    Sep 20, 2010
    Posts:
    18
    I was not aware of that error and will take a look at it. I am on vacation the rest of this week, but will upload a fixed version as soon as possible. Until then, I will have to apologize for the error.

    Regards,
    Tore Sønberg Madsen
    Apex Virtual Entertainment
     
  13. jedy

    jedy

    Joined:
    Aug 1, 2010
    Posts:
    579
    I am trying this for sure!
     
  14. soenberg

    soenberg

    Joined:
    Sep 20, 2010
    Posts:
    18
    @tbgBK: I have uploaded the fixed version to the same location as previously. If you download the fixed version and replace it in your project, webplayer builds should work now.

    @jedybg: I'm very glad to hear that :)

    Regards,
    Tore Sønberg Madsen
     
  15. KlingOne

    KlingOne

    Joined:
    Dec 1, 2010
    Posts:
    9
    I really like what you have done here.
    The only thing I'm missing so far is the possiblity to add an Image to a Button.
     
  16. haimmaik

    haimmaik

    Joined:
    Apr 18, 2010
    Posts:
    17
    Great plugin!..
    Is there anything that can be done about the drawcalls? each child of the gui is +1 drawcall.
     
  17. soenberg

    soenberg

    Joined:
    Sep 20, 2010
    Posts:
    18
    Welcome to the thread guys. It's great to know that there are someone that can use this tool.

    @KlingOne: Right now, adding an image to a button is done by setting the GUIStyle of the button to a style defined with an image. Perhaps I should add the possibility of assigning a texture to a button that fills the extents of the button.

    @haimmaik: I aggre with you that the draw calls are an issue and always have been in UnityGUI. When I started working on this tool, I initially wanted to do a custom implementation of each element using planes. This was unfortunately scrapped to allow the tool to be useable in a shorter amount of time. I still would like to do a sprite based GUI rendering system that uses only one draw call, but right now it is up to my project manager whether I can be given the time to implement this.

    Thanks alot for the great feedback!

    Regards,
    Tore Sønberg Madsen
     
  18. lochlainn1066

    lochlainn1066

    Joined:
    Nov 22, 2010
    Posts:
    12
    This is very nice! Works easily and quickly.

    Please convince your project manager to let you continue to work on this!
     
  19. KlingOne

    KlingOne

    Joined:
    Dec 1, 2010
    Posts:
    9
    I haven't customized a GUI before so I didn't konw about GUIStyles. But since I now know about them I don't think you need to implement a special image button.

    You probably know about this bug allready, since the documentaion states that data containers are currently under development, but when you add a GUIDataSelectionGrid a whole bunch of null reference exceptions get thrown. And if you try to change the GUILayout after that Unity crashes.

    It would be cool if one of the next versions would support data containers, to be able to construct some guielements from within code.

    Keep up the good work.
     
  20. LuckyWolf19

    LuckyWolf19

    Joined:
    Dec 6, 2010
    Posts:
    9
    This is nice work Tore!

    My initial thoughts:

    1. It would be great to add a button to the GUI Toolbar call Form. It would create a form under the root. (or is this what root is? If yes, then rename "root" to "form")
    2. Not allow any non-form controls to be added to the root. They have to be placed under a form.
    3. When we click a form, it opens that form in the editor.
    4. For the button control, add an inspector property to have it load another form. (aka form navigation).
    5. Add optional close buttons to top right of form.
    6. Allow form size to inputed.
    7. Allow form header, alignment, and color to be inputed
    8. Add a skin editor and/or viewer.
    7. Right align for labels.
    8. Make initial label control size about 25 in height


    Just thoughts, so please take them for what their worth. Keep up the good work. If you need any help, please don't hesitate to ask.

    Scott Peal
    Global Chief Architect
     
  21. generalmcmutton

    generalmcmutton

    Joined:
    May 20, 2010
    Posts:
    42
    This is a pretty useful tool. Nice work! Currently, I'm trying to write a code that will toggle a child text box's visibility when you enter/leave a certain trigger box, but I don't think the code is written in English, so I'm not sure how to do it.
     
  22. DarthBenedict

    DarthBenedict

    Joined:
    Dec 7, 2010
    Posts:
    26
    How do I handle the events generated by clicks on the buttons etc? I managed to get a decent looking menu up in a few minutes, but didn't see anything on how to make it actually do anything in the manual.
     
  23. KlingOne

    KlingOne

    Joined:
    Dec 1, 2010
    Posts:
    9
    Just look into the demo unitypackage. There is an example which demonstrates everything.
     
  24. DarthBenedict

    DarthBenedict

    Joined:
    Dec 7, 2010
    Posts:
    26
  25. slgooding

    slgooding

    Joined:
    Jan 12, 2009
    Posts:
    112
    Is there a way to wrap text in a text field?
     
  26. slgooding

    slgooding

    Joined:
    Jan 12, 2009
    Posts:
    112
    BUG?

    I pasted a multiple line text into a label and when i delete the text it only removes the first line. The other lines remain.
     
  27. soenberg

    soenberg

    Joined:
    Sep 20, 2010
    Posts:
    18
    Again, thank you all for the feedback. It's great to know that the tool is being used by you guys, as that was the purpose of the tool to begin with. I am currently working on ColdGUI 0.2 and there are quite a few bug fixes and new features in this next version.

    @tbgBK: In the upcoming release I will add a section in the manual explaining in more detail how to expand the range of components.

    @KlingOne: I have corrected the bugs that were in the current data container code and added a more simple GUIDataGroup. The next release should contain both a demo data container and proper documentation in the manual.

    @LuckyWolf19: You have a lot of great suggestions, and I will take them all into consideration. Instead of viewing the GUIRoot as a form, try instead looking at it as a canvas or display on which you render your gui. What I can definitely say will be in the next released version is a GUIStyle editor that allows you to edit the currently selected custom style without having to navigate to the GUISkin in the project view.

    @GeneralMcMutton: In the demo package provided with the release, I have a tool tip display label that is activated through the mouseOver delegate of the GUIRoot. This delegate should allow you to handle mouse over events for all GUIComponents that have Ids defined.

    @slgooding: You can set a text field to wrap by using a custom style in the GUISkin to do word wrapping instead of overflow. In the next release this will be a lot easier as you can access the custom styles directly in the inspector of the component. When deleting multi line strings in the Unity editor, remember to hit alt+A to select all lines before pressing delete. This is a Unity editor related issue and not unique to ColdGUI.

    I will be back as soon as I have more news on the release of ColdGUI 0.2. As always, let med know if you come across any bugs and I will do my best to sort them out as soon as possible.

    Regards,
    Tore Sønberg Madsen
    Apex Virtual Entertainment
     
  28. Werit

    Werit

    Joined:
    Dec 12, 2010
    Posts:
    38
    Very nice. I can't seem to get Draw Border to work though. Thanks for this nice tool!
     
  29. soenberg

    soenberg

    Joined:
    Sep 20, 2010
    Posts:
    18
    You're welcome!

    @spaceshooter: Draw Borders only apply to when scale mode is set to ScaleToFit, as the other scale modes will make the gui fill the entire screen space. I have considered drawing borders when scale mode is set to NoScale, and this might be included in the next release.

    Regards,
    Tore Sønberg Madsen
    Apex Virtual Entertainment
     
  30. Werit

    Werit

    Joined:
    Dec 12, 2010
    Posts:
    38
    Is there anyway to assign a GUIContent object to a GUILabel when using ColdGUI?

    It also seems that MouseOverDelegate is only a part of GUIRoot, not GUILabel (for example).
     
    Last edited: Dec 17, 2010
  31. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    very impressive for an initial release, I look forward to any updates you post. I agree with many of the point LuckyWolf19 brought up, but aside from those, GREAT START to the script, and thank you for sharing.
     
  32. soenberg

    soenberg

    Joined:
    Sep 20, 2010
    Posts:
    18
  33. EmadGh

    EmadGh

    Joined:
    Jun 10, 2009
    Posts:
    147
    Hey, This is really cool,
    But one thing, when we rotate a Gui element, we cant move it correctly. e.g. I rotate it 90deg, when I move it up it move right.

    Thanks
     
  34. soenberg

    soenberg

    Joined:
    Sep 20, 2010
    Posts:
    18
    @emadgh: Rotation of gui elements are a somewhat tricky feature as the matrix of the gui element and child elements is rotated, thereby rotating the translation of the element. This works in the same way as if you rotate a transform in the scene view and translate it along an axis. The object will be moved according to the rotated matrix of the transform. As the mouse movement cannot (and should not) be rotated, the behaviour with the irregular rotated motion will appear. I hope this explanation helps.

    Regards,
    Tore Sønberg Madsen
    Apex Virtual Entertainment
     
  35. KlingOne

    KlingOne

    Joined:
    Dec 1, 2010
    Posts:
    9
    Hi,
    Great new release, but I have a question.
    How would i go about creating a dynamic dataContainer to which I can add buttons at runtime.
    I looked at the DataContainerDemo and replaced the labels with buttons, which worked fine. I was also able to hook up a delegate to check for button presses. The problem is that thisway I can not determine which of the generated buttons has been pressed.
    Then I looked at the GUIDataSelectionGrid and hooked up the SelectedDelegate, but was unable to get it fired for buttons I added to the grid like in your example.

    Thx in advance. Keep up the great work
     
  36. EmadGh

    EmadGh

    Joined:
    Jun 10, 2009
    Posts:
    147
    Yes, thanks
     
  37. soenberg

    soenberg

    Joined:
    Sep 20, 2010
    Posts:
    18
    @KlingOne: I have uploaded a version 0.2.1 where I have added the sender of the event to all delegates. This requires a bit of rework in the existing event hendling, but it is now possible to identify the button in the data container that has been pressed. I hope this helps you with the desired functionality.

    Regards,
    Tore Sønberg Madsen
    Apex Virtual Entertainment
     
  38. KlingOne

    KlingOne

    Joined:
    Dec 1, 2010
    Posts:
    9
    Works perfectly.
    Thanks for the quick response.
     
  39. Anim

    Anim

    Joined:
    Aug 11, 2008
    Posts:
    289
    Trying to download but it sits there do nothing. Has the link gone down?
     
  40. soenberg

    soenberg

    Joined:
    Sep 20, 2010
    Posts:
    18
    @Anim: It works fine for me, but I cannot say if there have been problems when you tried it last. Please try again and I will take it to our webmaster if the problem persists.

    Regards,
    Tore Sønberg Madsen
    Apex Virtual Entertainment
     
  41. pakfront

    pakfront

    Joined:
    Oct 6, 2010
    Posts:
    551
    Looks cool. Two questions:
    What's the license? Are you planning on charging at some point?*
    How does runtime performance compare to GUIX and EZGUI?

    *not that that is bad, just would like to know.
     
  42. soenberg

    soenberg

    Joined:
    Sep 20, 2010
    Posts:
    18
    @pakfront: The license type for ColdGUI hasn't been decided quite yet. I will try and talk with the people who make that decision and see if we can get some clarity on the matter. As for performance, I haven't compared to GUIX or EZGUI, but I have optimized the performance in 0.2 compared to the initial release. As of right now, the ColdGUI code in itself is very efficient, and the only bottleneck in performance is Unity's own gui rendering. I have also made sure that no elements are drawn that are not visible, and as such draw calls have been reduced to the absolute minimum. The tests and demos that I have created, show that performance is a lot better than calling OnGUI on seperate scripts for each component.

    I am considering a (distant) future release with custom rendering of gui elements, which would allow me to control performance even more closely.

    Regards,
    Tore Sønberg Madsen
    Apex Virtual Entertainment
     
  43. pakfront

    pakfront

    Joined:
    Oct 6, 2010
    Posts:
    551
    Thanks for the info. I've been trying it out and it looks promising. My only comment is that the docs should have an initial section and example on using the delegate based Event system. It's stuff I know and was able to grok from the example code but many users are not familiar with the concept.
     
  44. Adamo

    Adamo

    Joined:
    Dec 17, 2010
    Posts:
    55
    ColdGUI is very good!! I've just download ColdGUI_0.2.1 and managed to create simple tests programs in minutes.

    I'm run a *.ogg movie in GUIMovieTexture but I cannot hear its audio (The Audio Listener in my Main Camera is enabled).

    • How to hear audio from movies running in GUIMovieTextures?

    -Adamo
     
  45. Tamer

    Tamer

    Joined:
    Jan 10, 2011
    Posts:
    11
    Dear Tore Sønberg Madsen,

    ColdGUI is cool/cold (i,e very nice).

    Its graphical editor is very easy to use. It is easy to build GUI in ColdGUI. I am going to study it to find out how to use in C# scripts. I wish we would see more comprehensive demos highlighting all the features of ColdGUI.

    Is its source code going to be available as freeware or as commercially product?​

    -Tamer-
     
  46. jabs

    jabs

    Joined:
    Sep 30, 2010
    Posts:
    3
    Will check this up first thing in the morning.
     
  47. Sriro

    Sriro

    Joined:
    Jan 30, 2011
    Posts:
    1
    Hi I am new to Unity and this might have been already answered but I have not been able to find the answer. When I attempt to add the GUI I get the following errors. I d-loaded the version from the link (ColdGUI 0.2.1 for Unity 3.1)

    Assets/Demo/DataContainerDemo/DataContainerDemoEventHandler.cs(3,7): error CS0246: The type or namespace name `DK' could not be found. Are you missing a using directive or an assembly reference?

    Am I missing something?

    Thanks in advance
     
  48. Delusive

    Delusive

    Joined:
    Jan 9, 2011
    Posts:
    16
    Am i seriously the onlyone that doesnt get the visual editor?
     
  49. soenberg

    soenberg

    Joined:
    Sep 20, 2010
    Posts:
    18
    First off, thank you all for trying out ColdGUI. I have build this system for you and your feedback is crucial to make it even better. Please keep it coming :)

    @pakfront: You are absolutely right about the documentation of the event system. Since I use the standard C# delegates, I have not focussed on documenting them as they are described in detail other places online (i.e. MSDN network), but I should add some basic explanation in the manual and I will add it for the next release.

    @Adamo: At the moment I do not call Play on the audioclip associated with the movie texture. It would be a simple addition to the component to let the sound play along side the movie. If you would like it, I could add it for the next release of ColdGUI.

    @Tamer: We have discussed the possibility of releasing the code as open source, but have not yet come to a final decission. I have tried to make the system as easy as possible to expand, and if you are really missing some core features, let me know and I will see what I can do :)

    @Sriro: Have you made sure to import both the demo package and the ColdGUI package? It sounds like you haven't gotten the ColdGUI dll included in the project.

    @Delusive: I do not understand what you mean by "get the visual editor"... Is it that you don't see a purpose for it or that you cannot find the actual editor?

    Regards,
    Tore Sønberg Madsen
    Apex Virtual Entertainment
     
  50. KlingOne

    KlingOne

    Joined:
    Dec 1, 2010
    Posts:
    9
    Hi,
    I've found a few bugs in the current release:

    1. If a scrollbar appears in a guiGroup thats inside another guiGroup the scrollbar gets displayed at the wrong place. The way it looks the position of the scrollbar gets calculated based on the guiRoot and not based on the coordinates of the guiGroup. I've taken a screenshot to illustrate what I mean.

    2. The position of buttons can not be changed by dragging them since the editor seems to register it as a normal click on the button.

    Oh and a dropdown list would be cool. See: http://www.unifycommunity.com/wiki/index.php?title=DropDownList

    Other than that (and the sometimes bad performance) I love coldGUI so keep up the good work!