Exemplo n.º 1
0
        //----------------------
        private static void f_width_width(GObject u1, GObject u2, RelationData data, bool percent)
        {
            float v = data.rightDist - data.leftDist;

            if (percent)
            {
                v = v / data.targetWidth * u2.width;
            }
            u1.width = u2.width + v;
        }
Exemplo n.º 2
0
        private static void f_height_height(GObject u1, GObject u2, RelationData data, bool percent)
        {
            float v = data.bottomDist - data.topDist;

            if (percent)
            {
                v = v / data.targetHeight * u2.height;
            }
            u1.height = u2.height + v;
        }
Exemplo n.º 3
0
        private static void f_bottomext_bottom(GObject u1, GObject u2, RelationData data, bool percent)
        {
            float h = u2.height;
            float v = data.bottomDist;

            if (percent)
            {
                v = v / data.targetHeight * h;
            }
            u1.height = u1.height + h + v - u1.height;
            Debug.Log("f_bottomext_bottom" + u1.height);
        }
Exemplo n.º 4
0
        private static void f_bottom_bottom(GObject u1, GObject u2, RelationData data, bool percent)
        {
            float y = u2 != u1.parent?u2.y:0;
            float h = u2.height;
            float v = data.bottomDist;

            if (percent)
            {
                v = v / data.targetHeight * h;
            }
            u1.y = y + h + v - u1.height;
        }
Exemplo n.º 5
0
        //----------------------
        private static void f_middle_middle(GObject u1, GObject u2, RelationData data, bool percent)
        {
            float y = u2 != u1.parent?u2.y:0;
            float h = u2.height;
            float v = data.middleDist;

            if (percent)
            {
                v = v / data.targetHeight * h;
            }
            u1.y = y + h / 2 + v - u1.height / 2;
        }
Exemplo n.º 6
0
        //----------------------
        private static void f_top_top(GObject u1, GObject u2, RelationData data, bool percent)
        {
            float y = u2 != u1.parent?u2.y:0;
            float h = u2.height;
            float v = data.topDist;

            if (percent)
            {
                v = v / data.targetHeight * h;
            }
            u1.y = y + v;
        }
Exemplo n.º 7
0
        private static void f_right_right(GObject u1, GObject u2, RelationData data, bool percent)
        {
            float x = u2 != u1.parent?u2.x:0;
            float w = u2.width;
            float v = data.rightDist;

            if (percent)
            {
                v = v / data.targetWidth * w;
            }
            u1.x = x + w + v - u1.width;
        }
Exemplo n.º 8
0
        //----------------------
        private static void f_center_center(GObject u1, GObject u2, RelationData data, bool percent)
        {
            float x = u2 != u1.parent?u2.x:0;
            float w = u2.width;
            float v = data.centerDist;

            if (percent)
            {
                v = v / data.targetWidth * w;
            }
            u1.x = x + w / 2 + v - u1.width / 2;
        }
Exemplo n.º 9
0
        private static void f_rightext_right(GObject u1, GObject u2, RelationData data, bool percent)
        {
            float x = u2 != u1.parent ? u2.x : 0;
            float w = u2.width;
            float v = data.rightDist;

            if (percent)
            {
                v = v / data.targetWidth * w;
            }
            u1.width = w + v;
            Debug.Log("f_rightext_right" + u1.width);
        }
Exemplo n.º 10
0
        private static void f_leftext_right(GObject u1, GObject u2, RelationData data, bool percent)
        {
            float x = u2 != u1.parent?u2.x:0;
            float w = u2.width;
            float v = data.leftDist - data.targetWidth;

            if (percent)
            {
                v = v / data.targetWidth * w;
            }
            float tmp = u1.x;

            u1.x     = x + w + v;
            u1.width = u1.width - (u1.x - tmp);
            Debug.Log("f_leftext_right  x:" + u1.x + " w:" + u1.width);
        }
Exemplo n.º 11
0
 public RelationItem(GObject owner)
 {
     _owner = owner;
     _defs  = new List <RelationDef>();
     _data  = new RelationData();
 }
Exemplo n.º 12
0
 private static void f_bottomext_top(GObject u1, GObject u2, RelationData data, bool percent)
 {
     //
 }
Exemplo n.º 13
0
 private static void f_rightext_left(GObject u1, GObject u2, RelationData data, bool percent)
 {
     //
 }