internal Image(Subtexture subTexture, Rectangle? clipRect, bool active) : base(active) { Texture = subTexture.Texture; if (clipRect.HasValue) ClipRect = subTexture.GetAbsoluteClipRect(clipRect.Value); else ClipRect = subTexture.Rect; }
public TiledImage(Subtexture source, Rectangle? clipRect, int width, int height, int offsetX = 0, int offsetY = 0) : base(false) { this.source = source; if (clipRect.HasValue) this.clipRect = source.GetAbsoluteClipRect(clipRect.Value); else this.clipRect = source.Rect; canvas = new Canvas(width, height); SetOffsets(offsetX, offsetY); }
public static void TextureCentered(Subtexture subTexture, Rectangle clipRect, Vector2 position, Color color, float scale, float rotation) { SpriteBatch.Draw(subTexture.Texture.Texture2D, Calc.Floor(position), subTexture.GetAbsoluteClipRect(clipRect), color, rotation, new Vector2(clipRect.Width / 2, clipRect.Height / 2), scale, SpriteEffects.None, 0); }
public static void Texture(Subtexture subTexture, Rectangle clipRect, Vector2 position, Color color) { SpriteBatch.Draw(subTexture.Texture.Texture2D, Calc.Floor(position), subTexture.GetAbsoluteClipRect(clipRect), color); }
static public void TextureCentered(Subtexture subTexture, Rectangle clipRect, Vector2 position, Color color, float scale, float rotation) { SpriteBatch.Draw(subTexture.Texture.Texture2D, Calc.Floor(position), subTexture.GetAbsoluteClipRect(clipRect), color, rotation, new Vector2(clipRect.Width / 2, clipRect.Height / 2), scale, SpriteEffects.None, 0); }
static public void Texture(Subtexture subTexture, Rectangle clipRect, Vector2 position, Color color) { SpriteBatch.Draw(subTexture.Texture.Texture2D, Calc.Floor(position), subTexture.GetAbsoluteClipRect(clipRect), color); }