示例#1
0
 public void Draw(SpriteBatch spriteBatch, Vector2 position, float scale, float angle, XYBool flip, Depth depth, Color color, bool isCentered = true)
 {
     this.spriteSheet.DrawFrame(spriteBatch, this.frame, position, scale, angle, flip, depth, color, isCentered);
 }
示例#2
0
 public WindowManager(UIStyle style, Depth baseDepth)
 {
     this.uiBuilder = new UIBuilder(style);
     this.baseDepth = baseDepth;
 }
示例#3
0
        public void DrawHorizontalThreepatch(SpriteBatch spriteBatch, NinepatchRects destinationRects, Depth layerDepth)
        {
            Debug.Assert(this.rects.IsValidHorizontalThreepatch, "Attempted to draw an invalid horizontal Threepatch");

            DrawSection(spriteBatch, NinepatchIndex.LeftCenter, destinationRects.LeftCenter, layerDepth);
            DrawSection(spriteBatch, NinepatchIndex.Center, destinationRects.Center, layerDepth);
            DrawSection(spriteBatch, NinepatchIndex.RightCenter, destinationRects.RightCenter, layerDepth);
        }
示例#4
0
        public void DrawVerticalThreepatch(SpriteBatch spriteBatch, NinepatchRects destinationRects, Depth layerDepth)
        {
            Debug.Assert(this.rects.IsValidVerticalThreepatch, "Attempted to draw an invalid vertical Threepatch");

            DrawSection(spriteBatch, NinepatchIndex.TopCenter, destinationRects.TopCenter, layerDepth);
            DrawSection(spriteBatch, NinepatchIndex.Center, destinationRects.Center, layerDepth);
            DrawSection(spriteBatch, NinepatchIndex.BottomCenter, destinationRects.BottomCenter, layerDepth);
        }
示例#5
0
        public void DrawFullNinepatch(SpriteBatch spriteBatch, NinepatchRects destinationRects, Depth layerDepth,
                                      float opacity = 1f)
        {
            Debug.Assert(this.rects.isValidNinepatch, "Attempted to draw an invalid Ninepatch.");

            for (var i = 0; i < 9; i++)
            {
                var dest   = destinationRects.raw[i];
                var source =
                    new Rectangle(0, 0, dest.Width,
                                  dest.Height); // Source is the size of the destination rect so we tile
                spriteBatch.Draw(this.textures[i], dest.Location.ToVector2(), source, Color.White.WithMultipliedOpacity(opacity),
                                 0f, new Vector2(), Vector2.One, SpriteEffects.None, layerDepth.AsFloat);
            }
        }
示例#6
0
 public void DrawVerticalThreepatch(SpriteBatch spriteBatch, Rectangle outer, Depth layerDepth)
 {
     DrawVerticalThreepatch(spriteBatch, GenerateDestinationRects(outer), layerDepth);
 }
示例#7
0
 public void DrawFullNinepatch(SpriteBatch spriteBatch, Rectangle starter, GenerationDirection gen,
                               Depth layerDepth, float opacity = 1f)
 {
     DrawFullNinepatch(spriteBatch, GenerateDestinationRects(starter, gen), layerDepth, opacity);
 }
示例#8
0
 public void DrawFrame(SpriteBatch spriteBatch, int index, Vector2 position, Depth layerDepth, Color color,
                       bool isCentered = true)
 {
     DrawFrame(spriteBatch, index, position, 1f, 0f, XYBool.False, layerDepth, color, isCentered);
 }
示例#9
0
 public void DrawFrame(SpriteBatch spriteBatch, int index, Vector2 position, Depth layerDepth, float angle = 0f)
 {
     DrawFrame(spriteBatch, index, position, 1f, angle, XYBool.False, layerDepth, Color.White);
 }
示例#10
0
 public abstract void DrawFrame(SpriteBatch spriteBatch, int index, Vector2 position, float scale, float angle,
                                XYBool flip, Depth layerDepth, Color tintColor, bool isCentered = true);
示例#11
0
 public void Draw(SpriteBatch spriteBatch, Vector2 position, float scale, float angle, XYBool flip,
                  Depth layerDepth, Color color)
 {
     this.spriteSheet.DrawFrame(spriteBatch, this.frame, position, scale, angle, flip, layerDepth, color);
 }