예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
 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();
 }
예제 #5
0
    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);
    }
예제 #6
0
    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);
    }
예제 #7
0
        /* 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;
            }
        }
예제 #8
0
        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();
        }
예제 #9
0
 //[API("667")]
 public virtual void startTouchDrag(int touchPointID, bool lockCenter = false, Rectangle bounds = null)
 {
     throw new NotImplementedException();
 }
예제 #10
0
 extern public virtual void startDrag(bool lockCenter = false, Rectangle bounds = null);
예제 #11
0
 public void fillRect(Rectangle rect, uint color)
 {
     XnaGame.Instance.FlashRenderer.FillRect(renderTarget, rect, color);
 }
예제 #12
0
 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);
 }
예제 #13
0
 public void copyPixels(string text, Rectangle sourceRect, Point destPoint, float alpha)
 {
     XnaGame.Instance.FlashRenderer.DrawText(renderTarget, text, sourceRect, destPoint, Color.White * alpha);
 }
예제 #14
0
 public void colorTransform(Rectangle rect, ColorTransform colorTransform)
 {
 }
예제 #15
0
 public void DrawText(RenderTarget2D renderTarget, string text, Rectangle sourceRect, Point destPoint, uint color, float alpha)
 {
     this.DrawText(renderTarget, text, sourceRect, destPoint, UIntToColor(color) * alpha);
 }