Ejemplo n.º 1
0
        private GuiContainer createSkillsArea()
        {
            var container = new GuiContainer(WIDTH, HEIGHT);

            skillNames           = new GuiLabel(10, 0, "");
            skillNames.FontColor = baseColor;
            skillNames.FontSize  = 14;

            skillValues           = new GuiLabel(140, 0, "", 100);
            skillValues.FontColor = baseColor;
            skillValues.TextAlign = TextAnchor.MiddleCenter;
            skillValues.FontSize  = 14;

            skillProgressBar = new GuiProgressBar[CoM.Skills.Count];

            for (int lp = 0; lp < CoM.Skills.Count; lp++)
            {
                var progressBar = new GuiProgressBar(100, 16);
                progressBar.X                = 140;
                progressBar.Color            = Color.black.Faded(0.25f);
                progressBar.ProgressColor    = Color.gray.Faded(0.5f);
                progressBar.EnableBackground = true;
                progressBar.Visible          = false;
                skillProgressBar[lp]         = progressBar;
                container.Add(progressBar);
            }

            container.Add(skillNames);
            container.Add(skillValues);

            return(container);
        }
Ejemplo n.º 2
0
        protected override void LoadContent()
        {
            var viewportAdapter = new BoxingViewportAdapter(Window, GraphicsDevice, 800, 480);

            _camera = new Camera2D(viewportAdapter);

            var titleScreen = LoadScreen(@"Content/title-screen.json");
            var guiRenderer = new GuiSpriteBatchRenderer(GraphicsDevice, titleScreen.Skin.DefaultFont, _camera.GetViewMatrix);

            _guiSystem = new GuiSystem(viewportAdapter, guiRenderer)
            {
                Screen = titleScreen
            };

            var panel = titleScreen.FindControl <GuiPanel>("MainPanel");

            var closeButton = titleScreen.FindControl <GuiButton>("CloseButton");

            closeButton.Clicked += (sender, args) => { panel.IsVisible = false; };

            var quitButton = titleScreen.FindControl <GuiButton>("QuitButton");

            quitButton.Clicked += (sender, args) => Exit();

            _progressBar = titleScreen.FindControl <GuiProgressBar>("ProgressBar");
        }
Ejemplo n.º 3
0
        public SplashScreen()
        {
            Background = Color.White;
            Background.TextureResource = GuiTextures.SplashBackground;
            Background.RepeatMode      = TextureRepeatMode.ScaleToFit;

            AddChild(_progressBarContainer = new GuiContainer()
            {
                Width  = 300,
                Height = 35,
                Margin = new Thickness(12),

                Anchor = Alignment.BottomCenter,
            });

            _progressBarContainer.AddChild(_textDisplay = new GuiTextElement()
            {
                Text      = Text,
                TextColor = TextColor.Black,

                Anchor    = Alignment.TopLeft,
                HasShadow = false
            });

            _progressBarContainer.AddChild(_percentageDisplay = new GuiTextElement()
            {
                Text      = Text,
                TextColor = TextColor.Black,

                Anchor    = Alignment.TopRight,
                HasShadow = false
            });

            _progressBarContainer.AddChild(_progressBar = new GuiProgressBar()
            {
                Width  = 300,
                Height = 9,

                Anchor = Alignment.MiddleCenter,
            });

            _progressBarContainer.AddChild(_subTextDisplay = new GuiTextElement()
            {
                Text      = Text,
                TextColor = TextColor.Black,

                Anchor    = Alignment.BottomLeft,
                HasShadow = false
            });
        }
Ejemplo n.º 4
0
        public LoadingWorldState()
        {
            HeaderTitle.TranslationKey = "menu.loadingLevel";

            _textDisplay = new GuiTextElement()
            {
                Text      = Text,
                TextColor = TextColor.White,

                Anchor    = Alignment.TopLeft,
                HasShadow = false
            };

            _percentageDisplay = new GuiTextElement()
            {
                Text      = Text,
                TextColor = TextColor.White,

                Anchor    = Alignment.TopRight,
                HasShadow = false
            };

            _progressBar = new GuiProgressBar()
            {
                Width  = 300,
                Height = 9,

                Anchor = Alignment.BottomFill,
            };

            var progContainer = new GuiContainer()
            {
                Width  = 300,
                Height = 25,
            };

            progContainer.AddChild(_textDisplay);
            progContainer.AddChild(_percentageDisplay);
            progContainer.AddChild(_progressBar);

            var progressRow = Footer.AddRow(progContainer);

            UpdateProgress(LoadingState.ConnectingToServer, 10);
        }
Ejemplo n.º 5
0
        public GuiCharacterFrame()
            : base(WIDTH, HEIGHT)
        {
            Style           = Engine.GetStyleCopy("CharacterInfoPanel");
            DragDropEnabled = true;

            portrait       = new GuiImage(4, 4, null);
            portrait.Scale = 0.5f;
            Add(portrait);

            levelIcon = new GuiImage(26, 27, ResourceManager.GetSprite("Icons/Lv"));
            Add(levelIcon);
            pinIcon = new GuiImage(18, 27, ResourceManager.GetSprite("Icons/Pin"));
            Add(pinIcon);

            levelIcon.Visible = false;
            pinIcon.Visible   = false;

            stats          = new GuiLabel(32 + 3 + 3, 5, "", 100, 50);
            stats.FontSize = 12;
            Add(stats);

            hpBar = new GuiProgressBar(WIDTH - 4, 6);
            hpBar.EnableBackground = false;
            hpBar.ProgressColor    = Colors.CharacterInfoPanelHitsBar;
            Add(hpBar, 2, 40);

            spBar = new GuiVerticalProgressBar(6, Height - 11);
            spBar.EnableBackground = false;
            spBar.ProgressColor    = Colors.CharacterInfoPanelSpellsBar;
            Add(spBar, Width - 9, 2);

            primaryAction   = new GuiQuickAction(null, 0);
            secondaryAction = new GuiQuickAction(null, 1);

            Add(primaryAction, -10 - primaryAction.Width - 3, 10);
            Add(secondaryAction, -10, 10);

            OuterShadowColor  = Color.yellow;
            OuterShadowSprite = OUTER_EDGE;

            OnMouseDown += clicked;
        }
Ejemplo n.º 6
0
		public override void OnInspectorGUI()
		{
			if(_pb == null) _pb = (GuiProgressBar)target;



			_pb.MainSprite = EditorGUILayout.ObjectField("Progress bar sprite", _pb.MainSprite, typeof(Sprite), true) as Sprite;
			_pb.TextureWrapMode = (TextureWrapMode)EditorGUILayout.EnumPopup ("Wrap mode", _pb.TextureWrapMode);
			_pb.MaskSprite = EditorGUILayout.ObjectField("Mask sprite", _pb.MaskSprite, typeof(Sprite), true) as Sprite;

			EditorGUILayout.Space ();

			_showKnobSettings = EditorGUILayout.Foldout (_showKnobSettings, "Knob settings");
			EditorGUI.indentLevel += 1;
			if (_showKnobSettings) {
				_pb.Knob = EditorGUILayout.ObjectField("Transform", _pb.Knob, typeof(Transform), true) as Transform;
				_pb.KnobPositionOffset = EditorGUILayout.FloatField ("Position offset", _pb.KnobPositionOffset);
				_pb.KnobMinPercent = Mathf.Clamp(EditorGUILayout.FloatField ("Min percent", _pb.KnobMinPercent), 0f, 1f);
				_pb.KnobMaxPercent = Mathf.Clamp(EditorGUILayout.FloatField ("Max percent", _pb.KnobMaxPercent), 0f, 1f);
			}
			EditorGUI.indentLevel -= 1;

			_showTextSettings = EditorGUILayout.Foldout (_showTextSettings, "Text settings");

			EditorGUI.indentLevel += 1;
			if (_showTextSettings) {
				_pb.TextMesh = EditorGUILayout.ObjectField("Text mesh", _pb.TextMesh, typeof(TextMesh), true) as TextMesh;
				_pb.DigitsAfterComma = EditorGUILayout.IntField("Digits after comma", _pb.DigitsAfterComma);
				_pb.TextSuffix = EditorGUILayout.TextField("Suffix", _pb.TextSuffix);
				_pb.TextIndication = (TextIndicationType)EditorGUILayout.EnumPopup ("Indication type", _pb.TextIndication);
				_pb.SectorsCount = EditorGUILayout.IntField("Sectors count", _pb.SectorsCount);
			}

			EditorGUI.indentLevel -= 1;

			EditorGUILayout.Space ();
			_pb.Value = EditorGUILayout.Slider (_pb.Value, 0, 1);
			EditorGUILayout.Space ();

			if(GUI.changed)
				EditorUtility.SetDirty(_pb); 
		}
Ejemplo n.º 7
0
        public LoadingWorldState(IGameState parent = null)
        {
            GuiStackContainer progressBarContainer;

            AddChild(progressBarContainer = new GuiStackContainer()
            {
                //Width  = 300,
                //Height = 35,
                //Margin = new Thickness(12),

                Anchor            = Alignment.MiddleCenter,
                Background        = Color.Transparent,
                BackgroundOverlay = Color.Transparent,
                Orientation       = Orientation.Vertical
            });

            if (parent == null)
            {
                Background = new GuiTexture2D
                {
                    TextureResource = GuiTextures.OptionsBackground,
                    RepeatMode      = TextureRepeatMode.Tile,
                    Scale           = new Vector2(2f, 2f),
                };

                BackgroundOverlay = new Color(Color.Black, 0.65f);
            }
            else
            {
                ParentState           = parent;
                HeaderTitle.IsVisible = false;
            }

            progressBarContainer.AddChild(_textDisplay = new GuiTextElement()
            {
                Text      = Text,
                TextColor = TextColor.White,

                Anchor    = Alignment.TopCenter,
                HasShadow = false,
                Scale     = 1.5f
            });

            GuiElement element;

            progressBarContainer.AddChild(element = new GuiElement()
            {
                Width  = 300,
                Height = 35,
                Margin = new Thickness(12),
            });

            element.AddChild(_percentageDisplay = new GuiTextElement()
            {
                Text      = Text,
                TextColor = TextColor.White,

                Anchor    = Alignment.TopRight,
                HasShadow = false
            });

            element.AddChild(_progressBar = new GuiProgressBar()
            {
                Width  = 300,
                Height = 9,

                Anchor = Alignment.MiddleCenter,
            });

            progressBarContainer.AddChild(
                _subTextDisplay = new GuiTextElement()
            {
                Text = Text, TextColor = TextColor.White, Anchor = Alignment.BottomLeft, HasShadow = false
            });

            HeaderTitle.TranslationKey = "menu.loadingLevel";

            UpdateProgress(LoadingState.ConnectingToServer, 10);
        }