Code Monkey home page Code Monkey logo

opengui's People

Contributors

acolley avatar acrobot avatar gearsin avatar lokkij avatar mrzapp avatar munglo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opengui's Issues

Example for Code-only-usage

Hi there,

i am working on a project witch complete dynamic content and would like to use your GUI Framework on this; but though it's completely generated, I cannot do any of the GUI statically.

Could you please provide me a short introduction how I can get OpenGUI to display with pure programming?

regards,
Haimi

Rotation of UI Components?

Just curious, but it would appear I cannot rotate anything on the z-axis. Is rotation even supported currently? It would be great to have for the OGTexture, as I would like to rotate a texture for a loading screen. Actually, I just tried with a button and rotation doesn't work on it either. So, I highly recommend allowing rotation of OG UI widgets and stuff based on the standard transform.rotation. This would be great to have and allow you to compete with the new GUI system in 4.6 of unity3d. I can tell I would like this one much better just because of the drag and drop events for widgets that you have implemented. Heck, I would just be happy with rotation on the z axis. I could care less about rotation for the x and y, but those would be cool too for button flips and stuff.

Dynamic content scaling

Implementing a "target screen size" parameter for OGRoot.

On paper, it should just work by passing the width and height as arguments to GL.LoadPixelMatrix ( w, h ), but when the screen is scaled below the provided size, the clipping plane seems to scale independently, resulting in portions of the UI not rendering

Pivot doesn't work on OGScrollView

Title says it all: for some reason, the pivot property doesn't do anything on an OGScrollView. It's only the scrollview; the other widgets' pivot is working just fine.

Integrate Typogenic

Typogenic is a free plugin for rendering TrueType text, and I think we could avoid a lot of pain by making this plugin a dependency.

Crash when resizing an OGLabel

When I insert the second number when resizing an OGLabel, Unity crashes and gives an "error in gc": too many sections in heap. This occurs in both transform.scale and stretch. For example, when I want to scale the label to an X of 200, it crashes when I try to type the first 0.
I haven't had this problem before updating to the latest release with the ScrollView pivot fix and implementing the factor parameter for anchor, so that may have something to do with it.

Can't create a visable OGButton

So I need to create a connect button for each server in a serverbrowser is the situation. I did try to use the c# example of setting up the gameobject with the button but it failed. Don't think OGButton was a valid type for the new gameObject. So I figure it is because of the compilationorder. I did however create a gameobject and add the OGButton to it and it looks just fine in editor but it throws this on creation...

NullReferenceException: Object reference not set to an instance of an object
OGWidget.RecalcPosition () (at Assets/Plugins/OpenGUI/Scripts/OGWidget.js:166)
OGWidget.Recalculate () (at Assets/Plugins/OpenGUI/Scripts/OGWidget.js:265)
OGWidget.Start () (at Assets/Plugins/OpenGUI/Scripts/OGWidget.js:306)

Also I need to select it in the Hierarchy for it to draw and be visable.
Is there any way around this?

Code I use to set it up

GameObject btn = new GameObject ("ServerEntry");
                btn.transform.name = data.gameName;
                btn.transform.parent = transform;
                btn.transform.localPosition = new Vector3( 20, 34, 0);
                btn.transform.localScale = new Vector3( 300, 20, 0);
                btn.AddComponent<OGButton>();
                btn.GetComponent<OGButton> ().text = data.gameName;

Note that it creates it just fine and all looks ok valuewise. It seems to just fail on first draw.

I did try moving the button creation script around in compilationorder but it ends up the same. Luckily it is a single script that grabs a hostdata array from main game script so it can move around any way.

Making OGConsole work with opengui

So I started making a frontend for OGConsole using opengui and while I am far from done I hit this little snag.
OGConsole needs a flag in the inputfield to indicate if it changed so it can trigger an update of suggested autocompleted commands. Unless I am blind there is none right now in the normal OGTextField. I figure it could be a good thing to add though.

-edit-
It also expects to get a onChange flagged when OGScrollView is changed.

For now I'm commenting it out just to see what else fails and needs to be sorted. Figure I might aswell let you know and take notes here. Of course with the intent to share the working implementation after its done.

Direct drawing

This is a bit of a stretch, but it would be very cool: Make OpenGUI just as capable of in-line GUI programming as it is in GameObject-based form.

That is, we'd create methods like OG:Button ( String, Rect, ... ) : bool and call them from OGPage:DrawPage (), which would essentially be OpenGUI's version of OnGUI (). This needs a bit of restructuring, and there are some issues with material passes that need to be addressed, but overall, this would allow for more code-centric implementations while still maintaining the convenience of previewing your GUI outside play mode. It would also mean less widget management, which would ultimately result in a lighter CPU load.

Add Drag and Drop Widget

I would like to see a container that holds drag-droppable items (displayed as textures or text). If an item in the container is dragged onto a GameObject that accepts drops, a new GameObject is instantiated from the prefab linked to the item.

"Hall of mirrors" effect without camera in scene

Dragging a widget or changing its position now creates the "hall of mirrors" effect:
hom
This issue can be resolved by creating a camera object before creating the Root. The issue appears again if you delete the camera.
I thought this could be caused by the lack of a Camera component on Root, but when I try to add it it says it does have one, even though it is not visible in the inspector.

Helpful scripts

I just made a small script you stick on an empty gameobject and it will in runtime make sure any childs will have the current page of the OGRoot instance as parent.
Nothing complicated but could be very useful for others so I will share it here. But maybe there could be a portion of the wiki or somewhere where we could collect a few helpful OpenGUI scripts

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class keepOnPage : MonoBehaviour
{
    // Make sure all tracked objects have a unique name
        private OGRoot UIRoot;
        public List<GameObject> keepList = new List<GameObject> ();
        void Start ()
        {
                UIRoot = GameObject.Find ("GUIRoot").GetComponent<OGRoot> ();
        }

        void FixedUpdate ()
        {
                foreach (Transform child in transform) {

            if( !keepList.Exists ( item => item.name == child.name ) ){
                                keepList.Add (child.transform.gameObject);
                        }
                }

                setParents (UIRoot.currentPage.transform);
        }

        void setParents (Transform parent)
        {

                foreach (GameObject keep in keepList) {
                        keep.transform.parent = parent;
                }

        }
}

Getting errors with b10 after update

I suspect this is due to you working on something that is missing on my side or something similar but here is the error

NullReferenceException: Object reference not set to an instance of an object
UnityEngine.GUILayoutUtility.BeginLayoutGroup (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options, System.Type LayoutType) (at C:/BuildAgent/work/d3d49558e4d408f4/artifacts/EditorGenerated/GUILayoutUtility.cs:197)
UnityEditor.EditorGUILayout.BeginHorizontal (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/BuildAgent/work/d3d49558e4d408f4/artifacts/EditorGenerated/EditorGUI.cs:5030)
UnityEditor.EditorGUILayout.BeginHorizontal (UnityEngine.GUILayoutOption[] options) (at C:/BuildAgent/work/d3d49558e4d408f4/artifacts/EditorGenerated/EditorGUI.cs:5026)
OGPage.UpdateStyles () (at Assets/Plugins/OpenGUI/Scripts/OGPage.js:29)
OGRoot.GoToPage (System.String pageName) (at Assets/Plugins/OpenGUI/Scripts/OGRoot.js:74)
PageChanger.setPage (System.String page) (at Assets/Scripts/PageChanger.cs:89)
PageChanger.Start () (at Assets/Scripts/PageChanger.cs:23)

PageChanger.cs is a script I use to monitor the state of the game and if needed change the page on the OGRoot object. Basically a workaround since I got everything else written in C#.
So on start it called SetPage("StartMenu"). It all worked fine in b9.

the line...

EditorGUILayout.BeginHorizontal();

is in MonoDevelop highlighted as a type and not an object so is it just a typeO?

compile errors with Unity 4.5.0f6

Hi again. Just installed and ran the latest Unity and in an empty new project it throws these errors when importing the latest opengui-v0.9-beta-15.

Assets/Plugins/OpenGUI/Scripts/OGButton.js(10,29): BCE0018: The name 'Action' does not denote a valid type ('not found'). Did you mean 'System.Action'?
Assets/Plugins/OpenGUI/Scripts/OGButton.js(11,41): BCE0018: The name 'Action' does not denote a valid type ('not found'). Did you mean 'System.Action'?
Assets/Plugins/OpenGUI/Scripts/OGDrawHelper.js(58,30): BCE0018: The name 'Bezier' does not denote a valid type ('not found').

Optimise interaction for touch

Some widgets responses are delayed when using touch screens. EDIT: OGRoot doesn't register the TouchPhase.Ended event

Upgrade to b9 and lost fonts

In my OGSkin object that I set up from scratch I had 3 fonts setup. All working. Right now I made a project backup and updated the OpenGUI files to the b9 ones.
After that I have no fonts picked in my OGSkin. I can't even pick or drag and drop the ones I used before. Any ideas?
I Don't want to start from scratch again if avoidable.

Also a unrelated issue with OGTickBox.isSelectable. Does it work? I'd figure I'd use it as markup for not ready/ready flags but then it shouldn't be clickable. Right now you can still click with the mousepointer and tick/untick it.
Or is it just me assuming it should work that way but being wrong?

Multiple pages

Allow for multiple pages to be displayed simultaneously at runtime

Textrendering questions

So I gone and done something stupid with my project so now I would love if I could parse text for colourcodes and present the text accordingly. As far as i know it isn't possible but I would also guess it wouldn't be easy to implement. Any chance at all this could get implemented?
At the very least I would suggest being able to have linebreaks in textfield and label.

Is there any way to manipulate the color value of a style or directly to the object? I need a simple colour field to show the colour of the rgb values the players choose. Could do it differently but I figure I'd ask.

I know I had another question but I forgot it..

Anyway. I am now reinstalling windows, updating unity and so far my OGSkin haven't bugged out. Here's what I'm using it for https://www.youtube.com/watch?v=Xuc7cGjrkjU
Not much GUI right now but I have a whole IRC connection to build UI for. That's kinda what made me think of colours. Would love to have them but at the same time it might just be easier to make it in Unitys default UI.

Glyph rendering is slightly off in seemingly arbitrary areas

Glyphs will occasionally draw oddly in the pixel matrix. Theories are:

  • Somewhere along the line, a float is being rounded up/down to an int. Could be in the drawRct.
  • The texture import settings are locked by Unity (for now), but getting our fingers all over that would probably give us a few light bulb moments.
  • It's a which!

1erkie
...this is clearly sorcery...

OGTextField losing text alignment

When the textfield goes to active it loses the textalignment and uses default placement instead.
Might be that the style "active" isn't exposed at all?

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.