PyGame / Rabbyt - Understanding Coordinates

PyGame / Rabbyt - Understanding Coordinates

Postby Pythong » Thu Sep 05, 2013 7:34 pm

Hello,

I'm attempting to understand how I would properly display a sprite at the current mouse position. On PyGame, I could simply use pygame.mouse.get_pos() and it would return the current mouse position on the screen. However, with that being said, Rabbyt appears to "center the origin" of the screen different from PyGame. For example, on PyGame, the default coordinate draw position is (0,0), but Rabbyt changes that to something else. Due to this, my current code is incorrectly displaying the mouse sprite in the wrong position. In top of all this, Rabbyt appears to have inverted the Y coordinate. When I move the cursor down the mouse-sprite ascends, but when I ascend with my mouse cursor the mouse-sprite descends.

Furthermore, I am having trouble how to check for collisions between the mouse cursor and UI elements I created by sub-classing
Code: Select all
rabbyt.Sprite
.
Pythong
 
Posts: 1
Joined: Thu Sep 05, 2013 7:29 pm

Return to Game Development

Who is online

Users browsing this forum: W3C [Linkcheck] and 2 guests