ENTRY | DOWNLOAD | MANUAL | ONGOING | |
custom_interaction.py"""Redefine the standard interaction. by stephan) """ from slut import * class Atlantis(World): def onSetup(self): self.name = '[LMB]+[mouse movement] for Orbitation' self.ia = AtlantisInteraction() def onDraw(self): circle(0, 0, 1) class AtlantisInteraction(Interaction): def onMouseMove(self, event): x = event.pos[0] y = event.pos[1] dx = x - self.lastmousex dy = y - self.lastmousey if self.LMB: if -5 < dx < 5 or -5 < dy < 5: glo.world.camera.orbitBy(dy, dx, 0.0) self.lastmousex = x self.lastmousey = y return 1 atlantis = Atlantis() atlantis.run() |
|
Initiated by Stephan Hechenberger Thanks to CADRE's 103 |