Esempio n. 1
0
        internal Texture2dArea(Int32 left, Int32 top, Int32 right, Int32 bottom, Int32 textureWidth, Int32 textureHeight)
        {
            Left = left;
            Top = top;
            Right = right;
            Bottom = bottom;

            TopLeft = new Coordinate2i(left, top);
            BottomLeft = new Coordinate2i(left, bottom);
            TopRight = new Coordinate2i(right, top);
            BottomRight = new Coordinate2i(right, bottom);

            Width = right - left;
            Height = bottom - top;

            CoordinateArray = new Single[8];
            //TopLeft
            CoordinateArray[0] = (Single)left / textureWidth;
            CoordinateArray[1] = (Single)top / textureHeight;
            //BottomLeft
            CoordinateArray[2] = (Single)left / textureWidth;
            CoordinateArray[3] = (Single)bottom / textureHeight;
            //TopRight
            CoordinateArray[4] = (Single)right / textureWidth;
            CoordinateArray[5] = (Single)top / textureHeight;
            //BottomRight
            CoordinateArray[6] = (Single)right / textureWidth;
            CoordinateArray[7] = (Single)bottom / textureHeight;
        }
Esempio n. 2
0
 public Area2i(Coordinate2i topLeft, Coordinate2i bottomLeft, Coordinate2i topRight, Coordinate2i bottomRight)
 {
     _TopLeft = topLeft;
     _BottomLeft = bottomLeft;
     _TopRight = topRight;
     _BottomRight = bottomRight;
 }
Esempio n. 3
0
        public Texture2dArea(Int32 left, Int32 top, Int32 right, Int32 bottom, Int32 textureWidth, Int32 textureHeight)
        {
            _Left = left;
            _Top = top;
            _Right = right;
            _Bottom = bottom;

            _TopLeft = new Coordinate2i(left, top);
            _BottomLeft = new Coordinate2i(left, bottom);
            _TopRight = new Coordinate2i(right, top);
            _BottomRight = new Coordinate2i(right, bottom);

            _Width = right - left + 1; //zero based
            _Height = bottom - top + 1; //zero based

            _CoordinateArray = new Single[8];
            //TopLeft
            _CoordinateArray[0] = (Single)left / textureWidth;
            _CoordinateArray[1] = (Single)top / textureHeight;
            //TopRight
            _CoordinateArray[2] = (Single)right / textureWidth;
            _CoordinateArray[3] = (Single)top / textureHeight;
            //BottomRight
            _CoordinateArray[4] = (Single)right / textureWidth;
            _CoordinateArray[5] = (Single)bottom / textureHeight;
            //BottomLeft
            _CoordinateArray[6] = (Single)left / textureWidth;
            _CoordinateArray[7] = (Single)bottom / textureHeight;
        }
Esempio n. 4
0
 public void AddDebugInfoLine(String name, Coordinate2i data)
 {
     DebugInfoBuilder.Append(name);
     DebugInfoBuilder.Append(DebugInfoSeparator);
     DebugInfoBuilder.Append(data.ToString());
     DebugInfoBuilder.AppendLine();
 }