Home | Trees | Indices | Help |
|
---|
|
A Rect style object whose coordinates are given as a fraction of another rect's width and height
Pygame uses the Rect class to store rectangular coordinates. One problem with this representation is that coordinates are measured in pixels. This presents problems in a Myst game - what if you want to adjust the resolution of your image files? Using only rect, you would have to re-adjust the rects of the Hotspots inside that slide.
The RelativeRect addresses this ploblem. It stores coordinates as a fraction of another rect's width and height. In our example, the Hotspot's coordinates would be stored as a fraction of the rect from the Slide in which it resides.
|
|||
|
|||
Rect |
|
|
Creates a RelativeRect
|
Gets a pygame Rect that is equivalent to RelativeRect when in relation to another Rect.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Jan 20 14:56:50 2010 | http://epydoc.sourceforge.net |