コード例 #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
ファイル: SpriteSheet.cs プロジェクト: notexplosive/machina
 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
ファイル: SpriteSheet.cs プロジェクト: notexplosive/machina
 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
ファイル: SpriteSheet.cs プロジェクト: notexplosive/machina
 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
ファイル: Image.cs プロジェクト: notexplosive/machina
 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);
 }