def __init__(self,geomnode=None): if geomnode is None: scale = 0.024 left,right,bottom,top = -3*scale,3*scale,-4*scale,4*scale cm = CardMaker('Box') cm.setFrame(left,right,bottom,top) geomnode = cm.generate() ZNode.__init__(self,geomnode=geomnode,magnification=.8) Droppable.__init__(self) self.set_droppable(True) # Enable transparency and make the box invisible. self.np.setTransparency(TransparencyAttrib.MAlpha) self.np.setColor(.3,.3,.3,1) #self.np.setScale(scale) # Uncomment to apply a texture to the object. #tex = loader.loadTexture('card.png') #self.np.setTexture(tex) # The nodepath currently held by this box. self.contents = None # The boxlist that this box currently belongs to. self.boxlist = None
def drop(self,event): Droppable.drop(self,event) self.fill(event.draggable)