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); }
public WindowManager(UIStyle style, Depth baseDepth) { this.uiBuilder = new UIBuilder(style); this.baseDepth = baseDepth; }
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); }
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); }
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); } }
public void DrawVerticalThreepatch(SpriteBatch spriteBatch, Rectangle outer, Depth layerDepth) { DrawVerticalThreepatch(spriteBatch, GenerateDestinationRects(outer), layerDepth); }
public void DrawFullNinepatch(SpriteBatch spriteBatch, Rectangle starter, GenerationDirection gen, Depth layerDepth, float opacity = 1f) { DrawFullNinepatch(spriteBatch, GenerateDestinationRects(starter, gen), layerDepth, opacity); }
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); }
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); }
public abstract void DrawFrame(SpriteBatch spriteBatch, int index, Vector2 position, float scale, float angle, XYBool flip, Depth layerDepth, Color tintColor, bool isCentered = true);
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); }