Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/physics.py
diff options
context:
space:
mode:
authorDaniel Francis <francis@sugarlabs.org>2012-12-21 13:42:22 (GMT)
committer Daniel Francis <francis@sugarlabs.org>2012-12-21 13:42:22 (GMT)
commiteff264857d005719f081eb9fea1e8b099670d395 (patch)
treea72e25a9f519ab3f910fcbd9dc1bb0f3514c720c /physics.py
parent1587e845fc046bb63c81a0babc155186bcaf2fe7 (diff)
Fix cursor bug, try to fix journal data
Signed-off-by: Daniel Francis <francis@sugarlabs.org>
Diffstat (limited to 'physics.py')
-rw-r--r--physics.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/physics.py b/physics.py
index dec7eef..18aa7eb 100644
--- a/physics.py
+++ b/physics.py
@@ -34,8 +34,8 @@ import sugargame
sys.path.append("lib/")
import pkg_resources
# If your architecture is different, comment these lines and install the modules in your system.
-#sys.path.append("lib/Elements-0.13-py2.5.egg")
-#sys.path.append("lib/Box2D-2.0.2b1-py2.5-linux-i686.egg")
+sys.path.append("lib/Elements-0.13-py2.5.egg")
+sys.path.append("lib/Box2D-2.0.2b1-py2.5-linux-i686.egg")
import Box2D as box2d
import elements
import tools
@@ -72,7 +72,7 @@ class PhysicsGame:
self.world.add.ground()
# Fake a Sugar cursor for the pyGame canvas area
- self.show_fake_cursor = False
+ self.show_fake_cursor = True
pygame.mouse.set_cursor((8, 8), (0, 0), (0, 0, 0, 0, 0, 0, 0, 0),
(0, 0, 0, 0, 0, 0, 0, 0))
self.cursor_picture = pygame.image.load('standardcursor.png')
@@ -90,6 +90,9 @@ class PhysicsGame:
for event in pygame.event.get():
self.currentTool.handleEvents(event)
+ if event.type == MOUSEBUTTONUP:
+ if event.button == 1:
+ self.show_fake_cursor = True
if self.in_focus:
# Drive motors
@@ -115,7 +118,7 @@ class PhysicsGame:
# Show Sugar like cursor for UI consistancy
if self.show_fake_cursor:
self.screen.blit(self.cursor_picture,
- pygame.mouse.get_pos())
+ pygame.mouse.get_pos())
# Flip Display
pygame.display.flip()