Esempio n. 1
0
def poly4 (x0, y0, x1, y1, x2, y2, x3, y3, c, level = 0):
    c._param_colour ("seventh parameter to box is expected to be a colour")
    if level == 0:
        id = pgeif.poly4 (x0, y0, x1, y1, x2, y2, x3, y3, c._get_colour ())
        ob = object (box_t, id)
        ob._set_width (None)
        ob.c = c
        printf ("poly3 ")
        _register (id, ob)
    else:
        ob = object (fb_box_t, [x0, y0, x1, y1, x2, y2, x3, y3, pgeif.h2l (c._get_colour ())])
        _add (ob, level)
    return ob
Esempio n. 2
0
def box (x, y, w, h, c, level = 0):
    c._param_colour ("fifth parameter to box is expected to be a colour")
    if level == 0:
        id = pgeif.box (x, y, w, h, c._get_colour ())
        ob = object (box_t, id)
        ob._set_width (w)
        ob.c = c
        printf ("box ")
        _register (id, ob)
    else:
        ob = object (fb_box_t, [x, y, x+w, y, x+w, y+h, x+w, y+h, x, y+h, pgeif.h2l (c._get_colour ())])
        _add (ob, level)
    return ob
Esempio n. 3
0
def circle (x, y, r, c, level = 0):
    c._param_colour ("fourth parameter to box is expected to be a colour")
    if level == 0:
        id = pgeif.circle (x, y, r, c._get_colour ())
        print "circle id =", id
        printf ("circle ")
        ob = object (circle_t, id)
        _register (id, ob)
        ob.c = c
    else:
        print "pge: colour", c._get_colour ()
        ob = object (fb_circle_t, [x, y, r, pgeif.h2l (c._get_colour ())])
        _add (ob, level)
    return ob
Esempio n. 4
0
def circle(x, y, r, c, level=0):
    c._param_colour("fourth parameter to box is expected to be a colour")
    if level == 0:
        id = pgeif.circle(x, y, r, c._get_colour())
        print "circle id =", id
        printf("circle ")
        ob = object(circle_t, id)
        _register(id, ob)
        ob.c = c
    else:
        print "pge: colour", c._get_colour()
        ob = object(fb_circle_t, [x, y, r, pgeif.h2l(c._get_colour())])
        _add(ob, level)
    return ob
Esempio n. 5
0
def poly3(x0, y0, x1, y1, x2, y2, c, level=0):
    c._param_colour("seventh parameter to box is expected to be a colour")
    if level == 0:
        id = pgeif.poly3(x0, y0, x1, y1, x2, y2, c._get_colour())
        ob = object(box_t, id)
        ob._set_width(None)
        ob.c = c
        printf("poly3 ")
        _register(id, ob)
    else:
        ob = object(fb_box_t,
                    [x0, y0, x1, y1, x2, y2,
                     pgeif.h2l(c._get_colour())])
        _add(ob, level)
    return ob
Esempio n. 6
0
def box(x, y, w, h, c, level=0):
    c._param_colour("fifth parameter to box is expected to be a colour")
    if level == 0:
        id = pgeif.box(x, y, w, h, c._get_colour())
        ob = object(box_t, id)
        ob._set_width(w)
        ob.c = c
        printf("box ")
        _register(id, ob)
    else:
        ob = object(fb_box_t, [
            x, y, x + w, y, x + w, y + h, x + w, y + h, x, y + h,
            pgeif.h2l(c._get_colour())
        ])
        _add(ob, level)
    return ob