예제 #1
0
 public Lines(IScreen screen, DisplayLayer drawOrder, int lineWidth, Color lineColor, Color outlineColor)
     : base(screen, drawOrder)
 {
     this.lineWidth = lineWidth;
     points         = new List <Vector2> ();
     spriteBatch    = new SpriteBatch(screen.GraphicsDevice);
     texture        = ContentLoader.CreateTexture(Screen.GraphicsDevice, Color.White);
     LineColor      = lineColor;
     OutlineColor   = outlineColor;
     IsEnabled      = true;
     IsVisible      = true;
 }
예제 #2
0
 protected Texture2D GetTexture(IGameObject obj)
 {
     if (obj.Texture != null)
     {
         return(obj.Texture);
     }
     else
     {
         ModelColoring coloring = obj.Coloring;
         if (coloring is GradientColor)
         {
             return(ContentLoader.CreateGradient(Screen.GraphicsDevice, coloring as GradientColor));
         }
         else
         {
             return(ContentLoader.CreateTexture(Screen.GraphicsDevice, coloring.MixedColor));
         }
     }
 }
예제 #3
0
        public override void Draw(GameTime time)
        {
            base.Draw(time);

            if (IsVisible && IsEnabled)
            {
                spriteBatch.Begin();
                Texture2D backgroundTexture = ContentLoader.CreateTexture(Screen.GraphicsDevice, Color.White);
                spriteBatch.Draw(backgroundTexture, Bounds, BackgroundColor);

                if (HasScrollbar)
                {
                    Texture2D rectangleTexture = ContentLoader.CreateTexture(Screen.GraphicsDevice, Color.White);
                    Bounds    sliderBounds     = ScrollSliderInBarBounds.In(ScrollBarBounds);
                    spriteBatch.Draw(rectangleTexture, sliderBounds.Rectangle.Grow(1), Design.DefaultOutlineColor);
                    spriteBatch.Draw(rectangleTexture, sliderBounds.Rectangle, Design.DefaultLineColor);
                    // Log.Debug ("ScrollSliderBounds=", sliderBounds.Rectangle);
                    // Log.Debug ("ScrollBarBounds=", ScrollBarBounds.Rectangle);
                }
                spriteBatch.End();
            }
        }