Пример #1
0
    void OnGUI()
    {
        int aWidth  = 300;
        int aHeight = 250;

        Rect aRect = new Rect((Screen.width - aWidth) / 2, (Screen.height - aHeight) / 2, aWidth, aHeight);

        GUILayout.BeginArea(aRect);
        {
            KGFGUIUtility.BeginVerticalBox(KGFGUIUtility.eStyleBox.eBoxInvisible, GUILayout.ExpandHeight(true));
            {
                KGFGUIUtility.BeginHorizontalBox(KGFGUIUtility.eStyleBox.eBoxDarkTop);
                {
                    GUILayout.FlexibleSpace();
                    KGFGUIUtility.Label("KGFGUIUtility Tutorial", KGFGUIUtility.eStyleLabel.eLabel);
                    GUILayout.FlexibleSpace();
                }
                KGFGUIUtility.EndHorizontalBox();

                KGFGUIUtility.BeginVerticalBox(KGFGUIUtility.eStyleBox.eBoxMiddleVertical, GUILayout.ExpandHeight(true));
                {
                    GUILayout.FlexibleSpace();

                    KGFGUIUtility.BeginHorizontalPadding();
                    {
                        KGFGUIUtility.Button("Top", KGFGUIUtility.eStyleButton.eButtonTop, GUILayout.ExpandWidth(true));
                        KGFGUIUtility.Button("Middle", KGFGUIUtility.eStyleButton.eButtonMiddle, GUILayout.ExpandWidth(true));
                        KGFGUIUtility.Button("Bottom", KGFGUIUtility.eStyleButton.eButtonBottom, GUILayout.ExpandWidth(true));
                    }
                    KGFGUIUtility.EndHorizontalPadding();

                    GUILayout.FlexibleSpace();
                }
                KGFGUIUtility.EndVerticalBox();

                KGFGUIUtility.BeginHorizontalBox(KGFGUIUtility.eStyleBox.eBoxDarkBottom);
                {
                    KGFGUIUtility.BeginVerticalPadding();
                    {
                        KGFGUIUtility.Button("Left", KGFGUIUtility.eStyleButton.eButtonLeft, GUILayout.ExpandWidth(true));
                        KGFGUIUtility.Button("Center", KGFGUIUtility.eStyleButton.eButtonMiddle, GUILayout.ExpandWidth(true));
                        KGFGUIUtility.Button("Right", KGFGUIUtility.eStyleButton.eButtonRight, GUILayout.ExpandWidth(true));
                    }
                    KGFGUIUtility.EndVerticalPadding();
                }
                KGFGUIUtility.EndHorizontalBox();
            }
            KGFGUIUtility.EndVerticalBox();
        }
        GUILayout.EndArea();
    }
Пример #2
0
    private static void RenderHelpWindowMethod(int theWindowID)
    {
        GUILayout.BeginHorizontal();
        {
            GUILayout.FlexibleSpace();
            KGFGUIUtility.BeginVerticalBox(KGFGUIUtility.eStyleBox.eBoxInvisible, GUILayout.ExpandHeight(true));
            {
                KGFGUIUtility.BeginHorizontalPadding();
                {
                    KGFGUIUtility.BeginHorizontalBox(KGFGUIUtility.eStyleBox.eBoxDarkTop, GUILayout.ExpandWidth(true));
                    {
                        GUILayout.FlexibleSpace();
                        GUILayout.Label(KGFGUIUtility.GetLogo(), GUILayout.Height(50));
                        GUILayout.FlexibleSpace();
                    }
                    KGFGUIUtility.EndHorizontalBox();

                    KGFGUIUtility.BeginHorizontalBox(KGFGUIUtility.eStyleBox.eBoxBottom, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));
                    {
                        GUILayout.Label(itsCopyrightText, GUILayout.ExpandWidth(true));
                    }
                    KGFGUIUtility.EndHorizontalBox();

                    GUILayout.Space(KGFGUIUtility.GetSkinHeight());

                    KGFGUIUtility.BeginHorizontalBox(KGFGUIUtility.eStyleBox.eBoxDarkTop, GUILayout.ExpandWidth(true));
                    {
                        KGFGUIUtility.Label(itsOpenModule.GetName() + " version:", KGFGUIUtility.eStyleLabel.eLabelFitIntoBox);
                        KGFGUIUtility.Label(itsOpenModule.GetCurrentVersion().ToString(), KGFGUIUtility.eStyleLabel.eLabelFitIntoBox);
                        GUILayout.FlexibleSpace();
                        KGFGUIUtility.Label("req. KGFCore version:", KGFGUIUtility.eStyleLabel.eLabelFitIntoBox);
                        KGFGUIUtility.Label(itsOpenModule.GetRequiredCoreVersion().ToString(), KGFGUIUtility.eStyleLabel.eLabelFitIntoBox);
                    }
                    KGFGUIUtility.EndHorizontalBox();

                    KGFGUIUtility.BeginHorizontalBox(KGFGUIUtility.eStyleBox.eBoxDarkBottom, GUILayout.ExpandWidth(true));
                    {
                        KGFGUIUtility.BeginVerticalPadding();
                        {
                            if (KGFGUIUtility.Button(KGFGUIUtility.GetHelpIcon(), "documentation", KGFGUIUtility.eStyleButton.eButtonLeft, GUILayout.ExpandWidth(true)))
                            {
                                Application.OpenURL("http://www.kolmich.at/documentation/" + itsOpenModule.GetDocumentationPath());
                                itsOpenModule = null;
                            }

                            /*
                             * if(KGFGUIUtility.Button("user documentation", KGFGUIUtility.eStyleButton.eButtonMiddle, GUILayout.ExpandWidth(true)))
                             * {
                             *      Application.OpenURL("http://www.kolmich.at/documentation/frames.html");
                             *      itsOpenModule = null;
                             * }
                             */
                            if (KGFGUIUtility.Button(KGFGUIUtility.GetHelpIcon(), "forum", KGFGUIUtility.eStyleButton.eButtonMiddle, GUILayout.ExpandWidth(true)))
                            {
                                Application.OpenURL("http://www.kolmich.at/forum/" + itsOpenModule.GetForumPath());
                                itsOpenModule = null;
                            }
                            if (KGFGUIUtility.Button(KGFGUIUtility.GetHelpIcon(), "homepage", KGFGUIUtility.eStyleButton.eButtonRight, GUILayout.ExpandWidth(true)))
                            {
                                Application.OpenURL("http://www.kolmich.at");
                                itsOpenModule = null;
                            }
                        }
                        KGFGUIUtility.EndVerticalPadding();
                    }
                    KGFGUIUtility.EndHorizontalBox();
                }
                KGFGUIUtility.EndHorizontalPadding();
            }
            KGFGUIUtility.EndVerticalBox();
            GUILayout.FlexibleSpace();
        }
        GUILayout.EndHorizontal();
    }