Beispiel #1
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);
        }
Beispiel #2
0
 private void Dispose(bool disposing)
 {
     if (IconFrame != null)
     {
         IconFrame.Dispose();
     }
     if (IconInputBar != null)
     {
         IconInputBar.Dispose();
     }
     if (LabelText != null)
     {
         LabelText.Dispose();
     }
 }
Beispiel #3
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);
            }
        }