def addObject(name, type="box", p1=(0, 0), p2=(0, 0), text="", width=0.3, size=0, bold=False, color="coolblue", opts=""): obj = {} obj["name"] = name obj["width"] = width obj["text"] = text obj["bold"] = bold obj["color"] = color obj["opts"] = opts obj["size"] = utils.numToSize(size) obj["x1"], obj["y1"] = p1 obj["x2"], obj["y2"] = p2 obj["type"] = type # let's flag this slide and put a grid on it to help the user if (p1 == (0, 0) and p2 == (0, 0)): obj["grid"] = 1 # only add the object if it's not already there # this is important for when the GUI makes objects if name not in objs.keys(): objs[name] = obj
def object(type="box",p1=(0,0),p2=(0,0),text="",width=0.3,size=0,bold=False,color="coolblue",opts=""): obj = { } obj["width"] = width obj["text"] = text obj["bold"] = bold obj["color"] = color obj["opts"] = opts obj["size"] = utils.numToSize(size) obj["x1"], obj["y1"] = p1 obj["x2"], obj["y2"] = p2 obj["type"] = type # let's flag this slide and put a grid on it to help the user if(p1 == (0,0) and p2 == (0,0)): obj["grid"] = 1 return obj
def addObject(name,type="box",p1=(0,0),p2=(0,0),text="",width=0.3,size=0,bold=False,color="coolblue",opts=""): obj = { } obj["name"] = name obj["width"] = width obj["text"] = text obj["bold"] = bold obj["color"] = color obj["opts"] = opts obj["size"] = utils.numToSize(size) obj["x1"], obj["y1"] = p1 obj["x2"], obj["y2"] = p2 obj["type"] = type # let's flag this slide and put a grid on it to help the user if(p1 == (0,0) and p2 == (0,0)): obj["grid"] = 1 # only add the object if it's not already there # this is important for when the GUI makes objects if name not in objs.keys(): objs[name] = obj
def object(type="box", p1=(0, 0), p2=(0, 0), text="", width=0.3, size=0, bold=False, color="coolblue", opts=""): obj = {} obj["width"] = width obj["text"] = text obj["bold"] = bold obj["color"] = color obj["opts"] = opts obj["size"] = utils.numToSize(size) obj["x1"], obj["y1"] = p1 obj["x2"], obj["y2"] = p2 obj["type"] = type # let's flag this slide and put a grid on it to help the user if (p1 == (0, 0) and p2 == (0, 0)): obj["grid"] = 1 return obj