def __init__(self, hugpos, offset, aspect, plane, name): self.enabled = True self.name = name self.node = aspect2d.attachNewNode("guibutton")#@UndefinedVariable self.node.setTransparency(TransparencyAttrib.MAlpha) self.node.setAlphaScale(1) geom = GeomNode('plane') geom.addGeomsFrom(plane.getChild(0).getChild(0).node()) self.frame = self.node.attachNewNode(geom) self.frame.setScale(0.05) self.node.setTexture(loader.loadTexture(name+".png"))#@UndefinedVariable self.hugpos = hugpos self.offset = offset self.redraw(aspect)
def __init__(self, parent, color, hpr, dim): PandaNode.__init__(self, dim+'rotHandle') self.path = NodePath(self) self.parent = parent self.dim = dim circle = GeomNode('gnode') circle.addGeomsFrom(self.geomNode) self.clickable = ClickableNode('clickable') self.clickable.addChild(circle) self.clickable.addMouseListener(self) circlenp = self.path.attachNewNode(self.clickable) self.path.setColor(color) self.path.setHpr(hpr) self.mDownPos = Vec2()
def __init__(self, parent, color, hpr, dim): PandaNode.__init__(self, dim + 'rotHandle') self.path = NodePath(self) self.parent = parent self.dim = dim circle = GeomNode('gnode') circle.addGeomsFrom(self.geomNode) self.clickable = ClickableNode('clickable') self.clickable.addChild(circle) self.clickable.addMouseListener(self) circlenp = self.path.attachNewNode(self.clickable) self.path.setColor(color) self.path.setHpr(hpr) self.mDownPos = Vec2()
def __init__(self, parent, color, hpr, dim): PandaNode.__init__(self, dim+'handle') self.path = NodePath(self) self.parent = parent self.dim = dim arrow = GeomNode('gnode') arrow.addGeomsFrom(self.geomNode) arrownp = self.path.attachNewNode(arrow) arrownp.hide(BitMask32(1)) clickNode = ClickableNode('clicknode') clickNode.setDepthLevel(0.5) clickNode.addMouseListener(self) clicknp = self.path.attachNewNode(clickNode) clickgeom = clicknp.attachNewNode(GeomNode('clicknode')) clickgeom.hide(BitMask32(7)) clickgeom.node().addGeomsFrom(self.clickableGeomNode) linesegs = LineSegs() linesegs.setColor(color) linesegs.setThickness(2) linesegs.moveTo(Vec3(0, 0, -30)) linesegs.drawTo(Vec3(0, 0, -0.5)) linesegs.moveTo(Vec3(0, 0, 0.5)) linesegs.drawTo(Vec3(0, 0, 30)) lines = self.path.attachNewNode(linesegs.create()) lines.show(BitMask32(1)) lines.hide(BitMask32(2|4|8|16)) lines.setBin('opaque', 30, 100) lines.setAntialias(AntialiasAttrib.MNone) self.path.setColor(color) self.path.setHpr(hpr) self.mDownPos = Vec2()
def __init__(self, parent, color, hpr, dim): PandaNode.__init__(self, dim + 'handle') self.path = NodePath(self) self.parent = parent self.dim = dim arrow = GeomNode('gnode') arrow.addGeomsFrom(self.geomNode) arrownp = self.path.attachNewNode(arrow) arrownp.hide(BitMask32(1)) clickNode = ClickableNode('clicknode') clickNode.setDepthLevel(0.5) clickNode.addMouseListener(self) clicknp = self.path.attachNewNode(clickNode) clickgeom = clicknp.attachNewNode(GeomNode('clicknode')) clickgeom.hide(BitMask32(7)) clickgeom.node().addGeomsFrom(self.clickableGeomNode) linesegs = LineSegs() linesegs.setColor(color) linesegs.setThickness(2) linesegs.moveTo(Vec3(0, 0, -30)) linesegs.drawTo(Vec3(0, 0, -0.5)) linesegs.moveTo(Vec3(0, 0, 0.5)) linesegs.drawTo(Vec3(0, 0, 30)) lines = self.path.attachNewNode(linesegs.create()) lines.show(BitMask32(1)) lines.hide(BitMask32(2 | 4 | 8 | 16)) lines.setBin('opaque', 30, 100) lines.setAntialias(AntialiasAttrib.MNone) self.path.setColor(color) self.path.setHpr(hpr) self.mDownPos = Vec2()