setId() public method

public setId ( int id, int counter ) : void
id int
counter int
return void
Exemplo n.º 1
0
 static public int setId(IntPtr l)
 {
     try {
         LTRect       self = (LTRect)checkSelf(l);
         System.Int32 a1;
         checkType(l, 2, out a1);
         System.Int32 a2;
         checkType(l, 3, out a2);
         self.setId(a1, a2);
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Exemplo n.º 2
0
 static public int setId(IntPtr l)
 {
     try {
         LTRect       self = (LTRect)checkSelf(l);
         System.Int32 a1;
         checkType(l, 2, out a1);
         System.Int32 a2;
         checkType(l, 3, out a2);
         self.setId(a1, a2);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemplo n.º 3
0
    public static LTRect element(LTRect rect, int depth)
    {
        isGUIEnabled = true;
        init();
        int num  = depth * RECTS_PER_LEVEL + RECTS_PER_LEVEL;
        int num2 = 0;

        if (rect != null)
        {
            destroy(rect.id);
        }
        if (rect.type == Element_Type.Label && rect.style != null)
        {
            Color textColor = rect.style.normal.textColor;
            if (textColor.a <= 0f)
            {
                Debug.LogWarning("Your GUI normal color has an alpha of zero, and will not be rendered.");
            }
        }
        if (rect.relativeRect.width == float.PositiveInfinity)
        {
            rect.relativeRect = new Rect(0f, 0f, (float)Screen.width, (float)Screen.height);
        }
        for (int i = depth * RECTS_PER_LEVEL; i < num; i++)
        {
            r = levels[i];
            if (r == null)
            {
                r = rect;
                r.rotateEnabled = true;
                r.alphaEnabled  = true;
                r.setId(i, global_counter);
                levels[i] = r;
                if (num2 >= levelDepths[depth])
                {
                    levelDepths[depth] = num2 + 1;
                }
                global_counter++;
                return(r);
            }
            num2++;
        }
        Debug.LogError("You ran out of GUI Element spaces");
        return(null);
    }
Exemplo n.º 4
0
    public static LTRect element( LTRect rect, int depth)
    {
        isGUIEnabled = true;
        init();
        int maxLoop = depth*RECTS_PER_LEVEL + RECTS_PER_LEVEL;
        int k = 0;
        if(rect!=null){
            destroy(rect.id);
        }
        if(rect.type==LTGUI.Element_Type.Label && rect.style!=null){
            if(rect.style.normal.textColor.a<=0f){
                Debug.LogWarning("Your GUI normal color has an alpha of zero, and will not be rendered.");
            }
        }
        if(rect.relativeRect.width==float.PositiveInfinity){
            rect.relativeRect = new Rect(0f,0f,Screen.width,Screen.height);
        }
        for(int i = depth*RECTS_PER_LEVEL; i < maxLoop; i++){
            r = levels[i];
            if(r==null){
                r = rect;
                r.rotateEnabled = true;
                r.alphaEnabled = true;
                r.setId( i, global_counter );
                levels[i] = r;
                // Debug.Log("k:"+k+ " maxDepth:"+levelDepths[depth]);
                if(k>=levelDepths[depth]){
                    levelDepths[depth] = k + 1;
                }
                global_counter++;
                return r;
            }
            k++;
        }

        Debug.LogError("You ran out of GUI Element spaces");

        return null;
    }