Exemplo n.º 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);
 }
Exemplo n.º 2
0
 public WindowManager(UIStyle style, Depth baseDepth)
 {
     this.uiBuilder = new UIBuilder(style);
     this.baseDepth = baseDepth;
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 6
0
 public void DrawVerticalThreepatch(SpriteBatch spriteBatch, Rectangle outer, Depth layerDepth)
 {
     DrawVerticalThreepatch(spriteBatch, GenerateDestinationRects(outer), layerDepth);
 }
Exemplo n.º 7
0
 public void DrawFullNinepatch(SpriteBatch spriteBatch, Rectangle starter, GenerationDirection gen,
                               Depth layerDepth, float opacity = 1f)
 {
     DrawFullNinepatch(spriteBatch, GenerateDestinationRects(starter, gen), layerDepth, opacity);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
Exemplo n.º 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);
 }