Esempio n. 1
0
        public NinePatch(object tx, int x, int y, int w, int h, int Left, int Top, int Right, int Bottom)
            : base(0, 0, 0, 0)
        {
            texture = TextureCache.Get(tx);
            w       = w == 0 ? texture.Width : w;
            h       = h == 0 ? texture.Height : h;

            nWidth  = _Width = w;
            nHeight = _Height = h;

            vertices       = new float[16];
            verticesBuffer = Quad.CreateSet(9);

            marginLeft   = Left;
            marginRight  = Right;
            marginTop    = Top;
            marginBottom = Bottom;

            outterF = texture.UvRect(x, y, x + w, y + h);
            innerF  = texture.UvRect(x + Left, y + Top, x + w - Right, y + h - Bottom);

            UpdateVertices();
        }
Esempio n. 2
0
 public Image(object tx, int Left, int Top, int Width, int Height)
     : this(tx)
 {
     Frame(texture.UvRect(Left, Top, Left + Width, Top + Height));
 }