Пример #1
0
        public override void Draw(SharpDL.GameTime gameTime, Renderer renderer)
        {
            if (!Visible)
            {
                return;
            }

            renderer.SetRenderTarget(renderTarget);

            // draw our frame at 0,0 in the render target
            textureFrame.Draw(0, 0);

            // draw all the items of the listbox on top of the frame
            foreach (var item in items)
            {
                item.Draw(gameTime, renderer);
            }

            // reset our render target so that we render to the full screen now
            renderer.ResetRenderTarget();

            // render our final render target texture
            renderTarget.Draw(Position.X, Position.Y);

            iconScrollbar.Draw(gameTime, renderer);
            iconScroller.Draw(gameTime, renderer);
        }
Пример #2
0
        public override void Update(SharpDL.GameTime gameTime, bool otherWindowHasFocus, bool coveredByOtherScreen)
        {
            base.Update(gameTime, otherWindowHasFocus, coveredByOtherScreen);

            if (CurrentSelectState == ScenarioSelectState.FirstScreen)
            {
                iconFrame.Update(gameTime);

                if (iconActiveOverview != null)
                {
                    iconActiveOverview.Update(gameTime);
                }
                if (labelActiveOverview != null)
                {
                    labelActiveOverview.Update(gameTime);
                }

                foreach (var scenarioItem in GetScenarioItemsOnPage(currentPageNumber))
                {
                    scenarioItem.Update(gameTime);
                }
            }
            else if (CurrentSelectState == ScenarioSelectState.SecondScreen)
            {
                iconFrameInputNames.Update(gameTime);
                textboxInputCompanyName.Update(gameTime);
                textboxInputPlayerName.Update(gameTime);
                labelInputCompanyName.Update(gameTime);
                labelInputPlayerName.Update(gameTime);
            }

            labelTitle.Update(gameTime);
            buttonSelect.Update(gameTime);
            buttonBack.Update(gameTime);
        }
Пример #3
0
        public override void Update(SharpDL.GameTime gameTime)
        {
            if (!Visible)
            {
                return;
            }

            iconFrame.Update(gameTime);

            if (IsFocused)
            {
                timeSinceLastUpdate += gameTime.ElapsedGameTime;
                if (timeSinceLastUpdate > TimeSpan.FromSeconds(0.5))
                {
                    IconInputBar.Visible = true;

                    timeSinceVisibleTrue += gameTime.ElapsedGameTime;
                    if (timeSinceVisibleTrue > TimeSpan.FromSeconds(0.5))
                    {
                        timeSinceLastUpdate  = TimeSpan.Zero;
                        timeSinceVisibleTrue = TimeSpan.Zero;
                    }
                }
                else
                {
                    IconInputBar.Visible = false;
                }

                IconInputBar.Update(gameTime);
                LabelText.Update(gameTime);
            }

            base.Update(gameTime);
        }
        public override void Update(SharpDL.GameTime gameTime, bool otherWindowHasFocus, bool coveredByOtherScreen)
        {
            base.Update(gameTime, otherWindowHasFocus, coveredByOtherScreen);

            iconFrame.Update(gameTime);
            buttonResumeGame.Update(gameTime);
            buttonNewGame.Update(gameTime);
            buttonLoadGame.Update(gameTime);
            buttonOptions.Update(gameTime);
            buttonQuit.Update(gameTime);
        }
Пример #5
0
        public override void Update(SharpDL.GameTime gameTime)
        {
            if (!Visible)
            {
                return;
            }

            foreach (var item in items)
            {
                item.Update(gameTime);
            }

            iconScrollbar.Update(gameTime);
            iconScroller.Update(gameTime);

            base.Update(gameTime);
        }
        public override void Draw(SharpDL.GameTime gameTime, SharpDL.Graphics.Renderer renderer)
        {
            base.Draw(gameTime, renderer);

            for (int x = 0; x <= MainGame.SCREEN_WIDTH_LOGICAL / textureBackgroundStripeTile.Width; x++)
            {
                for (int y = 0; y <= MainGame.SCREEN_HEIGHT_LOGICAL / textureBackgroundStripeTile.Height; y++)
                {
                    textureBackgroundStripeTile.Draw(x * textureBackgroundStripeTile.Width, y * textureBackgroundStripeTile.Height);
                }
            }

            iconFrame.Draw(gameTime, renderer);
            buttonResumeGame.Draw(gameTime, renderer);
            buttonNewGame.Draw(gameTime, renderer);
            buttonLoadGame.Draw(gameTime, renderer);
            buttonOptions.Draw(gameTime, renderer);
            buttonQuit.Draw(gameTime, renderer);
        }
Пример #7
0
        public override void Draw(SharpDL.GameTime gameTime, Renderer renderer)
        {
            base.Draw(gameTime, renderer);

            for (int x = 0; x <= MainGame.SCREEN_WIDTH_LOGICAL / textureBackgroundTile.Width; x++)
            {
                for (int y = 0; y <= MainGame.SCREEN_HEIGHT_LOGICAL / textureBackgroundTile.Height; y++)
                {
                    textureBackgroundTile.Draw(x * textureBackgroundTile.Width, y * textureBackgroundTile.Height);
                }
            }

            if (CurrentSelectState == ScenarioSelectState.FirstScreen)
            {
                iconFrame.Draw(gameTime, renderer);

                if (iconActiveOverview != null)
                {
                    iconActiveOverview.Draw(gameTime, renderer);
                }
                if (labelActiveOverview != null)
                {
                    labelActiveOverview.Draw(gameTime, renderer);
                }

                foreach (var scenarioItem in GetScenarioItemsOnPage(currentPageNumber))
                {
                    scenarioItem.Draw(gameTime, renderer);
                }
            }
            else if (CurrentSelectState == ScenarioSelectState.SecondScreen)
            {
                iconFrameInputNames.Draw(gameTime, renderer);
                textboxInputCompanyName.Draw(gameTime, renderer);
                textboxInputPlayerName.Draw(gameTime, renderer);
                labelInputCompanyName.Draw(gameTime, renderer);
                labelInputPlayerName.Draw(gameTime, renderer);
            }

            labelTitle.Draw(gameTime, renderer);
            buttonSelect.Draw(gameTime, renderer);
            buttonBack.Draw(gameTime, renderer);
        }
Пример #8
0
        public override void Draw(SharpDL.GameTime gameTime, Renderer renderer)
        {
            if (!Visible)
            {
                return;
            }

            iconFrame.Draw(gameTime, renderer);

            if (IsFocused)
            {
                IconInputBar.Draw(gameTime, renderer);
            }

            if (HasText)
            {
                LabelText.Draw(gameTime, renderer);
            }
        }
Пример #9
0
        public override void Draw(SharpDL.GameTime gameTime, Renderer renderer)
        {
            if (!Visible)
            {
                return;
            }

            if (labelActive != null)
            {
                labelActive.Draw(gameTime, renderer);
            }

            if (iconActive != null)
            {
                iconActive.Draw(gameTime, renderer);
            }

            if (isSelected)
            {
                labelOverview.Draw(gameTime, renderer);
                iconOverview.Draw(gameTime, renderer);
            }
        }
Пример #10
0
        public override void Update(SharpDL.GameTime gameTime)
        {
            if (!Visible)
            {
                return;
            }

            base.Update(gameTime);

            if (IsHovered || isSelected)
            {
                iconActive  = iconThumbnailSelected;
                labelActive = labelNameSelected;
            }
            else
            {
                iconActive  = iconThumbnail;
                labelActive = labelName;
            }

            if (labelActive != null)
            {
                labelActive.Update(gameTime);
            }

            if (iconActive != null)
            {
                iconActive.Update(gameTime);
            }

            if (isSelected)
            {
                labelOverview.Update(gameTime);
                iconOverview.Update(gameTime);
            }
        }