Hi,
I would like to ask 2 questions: 1. How can I rotate an image or surface in SDL? 2. How can I get the mouse position during mouse moving in SDL?
Tamás _________________________________________________________________ Hotmail: Hatékony, ingyenes e-mail szolgáltatás a Microsoft által biztosított védelemmel. https://signup.live.com/signup.aspx?id=60969
- How can I rotate an image or surface in SDL?
Rotate the image using Image.Image()->rotate() before you write it to the surface with set_image().
- How can I get the mouse position during mouse moving in SDL?
When the event type is SDL.MOUSEMOTION, you can access the fields "x" and "y" of the event to find the mouse position.
thank you. and an other question: i need to set up the color key on a surface. but it needs a pixelformat parameter. and i coulnt find out how to initialize a pixelformat class. can anyone help?
tamas
From: 10353@lyskom.lysator.liu.se Subject: SDL - 2 questions To: pike-devel@lists.lysator.liu.se Date: Mon, 5 Jul 2010 11:05:02 +0000
- How can I rotate an image or surface in SDL?
Rotate the image using Image.Image()->rotate() before you write it to the surface with set_image().
- How can I get the mouse position during mouse moving in SDL?
When the event type is SDL.MOUSEMOTION, you can access the fields "x" and "y" of the event to find the mouse position.
_________________________________________________________________ Hotmail: Megbízható e-mail szolgáltatás a Microsoft hatékony LEVÉLSZEMÉT elleni védelmének használatával. https://signup.live.com/signup.aspx?id=60969
Your surface has a "format" field which contains the PixelFormat for that surface. Using that, you can map an Image.Color.Color object to the correct key value with the map_rgb() method.
pike-devel@lists.lysator.liu.se