public override Rectangle getBounds(DisplayObject targetCoordinateSpace, Rectangle result = null) { if (result == null) { result = new Rectangle(); } else { result.setEmpty(); } tempRectangle.setEmpty(); if (targetCoordinateSpace == null) { targetCoordinateSpace = this; } base.getBounds(targetCoordinateSpace, result); graphics.getBounds(targetCoordinateSpace, this, tempRectangle); result.union(tempRectangle, result); var offset = getOffsetFilter(); result.inflate(offset, offset); return(result); }
public void copyPixels(BitmapData sourceBitmapData, Rectangle sourceRect, Point destPoint, BitmapData alphaBitmapData = null, Point alphaPoint = null, Boolean mergeAlpha = false) { if (sourceBitmapData.texture == null) { return; } XnaGame.Instance.FlashRenderer.CopyPixels(renderTarget, sourceBitmapData, sourceRect, destPoint, alphaBitmapData, alphaPoint, mergeAlpha); }
public BitmapData(int width, int height, Boolean transparent = true, uint fillColor = 0xFFFFFFFF) { this.width = width; this.height = height; this.transparent = transparent; this.fillColor = fillColor; rect = new Rectangle(0, 0, width, height); }
public void setSize(int width, int height) { _width = width; _height = height; borderRect = new Rectangle(1, 1, _width - 2, _height - 2); boundsRect = new Rectangle(2, 2, _width - 4, _height - 4); bitmapData = new BitmapData(Renderer.GameSpriteSheet, width, height, true, 0x0); updateText(); draw(); }
public void DrawText(RenderTarget2D renderTarget, string text, Rectangle sourceRect, Point destPoint, Color color, BitmapData alphaBitmapData = null, Point alphaPoint = null, Boolean mergeAlpha = false) { //XnaGame.Instance.SpriteBatch.Draw(sourceBitmapData.texture, new Vector2(destPoint.x, destPoint.y), new Microsoft.Xna.Framework.Rectangle(sourceRect.x, sourceRect.y, sourceRect.width, sourceRect.height), Color.White); var info = new RenderInfo { Text = text, Destination = new Microsoft.Xna.Framework.Rectangle((int)destPoint.x, (int)destPoint.y, (int)sourceRect.width, (int)sourceRect.height), Color = color }; _queues[renderTarget ?? _defaultTarget].Add(info); }
public void FillRect(RenderTarget2D renderTarget, Rectangle rect, uint color, float alpha = 1.0f) { //XnaGame.Instance.SpriteBatch.Draw(_pixelTexture, new Microsoft.Xna.Framework.Rectangle(rect.x, rect.y, rect.width, rect.height), UIntToColor(color)); var info = new RenderInfo { Texture = _pixelTexture, Destination = new Microsoft.Xna.Framework.Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height), Source = null, Color = UIntToColor(color) * alpha }; _queues[renderTarget ?? _defaultTarget].Add(info); }
/* This must be called before any TextBox is created so sprites can be drawn */ public static void init(Array <Rectangle> characterList, BitmapData _spriteSheet) { spriteSheet = _spriteSheet; characters = new Dictionary <char, Rectangle>(); char characterName; Rectangle rect; for (int i = 0; i < characterList.length; i++) { if (characterList[i] != null) { rect = characterList[i]; } else { rect = new Rectangle(); } characterName = characterNames[i]; characters[characterName] = rect; } }
public TextBox(double _width, double _height, uint backgroundCol = 0xFF111111, uint borderCol = 0xFF99999U) { this._width = (int)_width; this._height = (int)_height; this.backgroundCol = backgroundCol; this.borderCol = borderCol; align = "left"; alignVert = "top"; _colorInt = 0x00FFFFFF; wordWrap = true; tracking = 0; leading = 1; whitespaceLength = 2; lineSpacing = 8; _text = ""; lines = new Array <Array <Rectangle> >(); borderRect = new Rectangle(0, 0, _width, _height); boundsRect = new Rectangle(0, 0, _width, _height); maskRect = new Rectangle(0, 0, 1, 1); bitmapData = new BitmapData(Renderer.GameSpriteSheet, (int)_width, (int)_height, true, 0x0); drawBorder(); }
//[API("667")] public virtual void startTouchDrag(int touchPointID, bool lockCenter = false, Rectangle bounds = null) { throw new NotImplementedException(); }
extern public virtual void startDrag(bool lockCenter = false, Rectangle bounds = null);
public void fillRect(Rectangle rect, uint color) { XnaGame.Instance.FlashRenderer.FillRect(renderTarget, rect, color); }
public void copyPixels(string text, Rectangle sourceRect, Point destPoint, BitmapData alphaBitmapData = null, Point alphaPoint = null, Boolean mergeAlpha = false) { XnaGame.Instance.FlashRenderer.DrawText(renderTarget, text, sourceRect, destPoint, Color.White, alphaBitmapData, alphaPoint, mergeAlpha); }
public void copyPixels(string text, Rectangle sourceRect, Point destPoint, float alpha) { XnaGame.Instance.FlashRenderer.DrawText(renderTarget, text, sourceRect, destPoint, Color.White * alpha); }
public void colorTransform(Rectangle rect, ColorTransform colorTransform) { }
public void DrawText(RenderTarget2D renderTarget, string text, Rectangle sourceRect, Point destPoint, uint color, float alpha) { this.DrawText(renderTarget, text, sourceRect, destPoint, UIntToColor(color) * alpha); }