[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

incorrect rect behavior... (was : [pygame] strange rect behavior...)



Mmmm....right and bottom seem broken

This :

       import pygame
       rect = pygame.Rect([0,0,0,0])
       rect.width = 100
       print 'rect.right ',rect.right
       rect.right = 50
       print 'rect.width ',rect.width
       print 'rect.left', rect.left

Gives :

   rect.right  100
   rect.width  100
   rect.left -50

Lionel.


Lionel barret De Nazaris wrote:
hello all,  (possibly newbie question)

If I write :
rect = pygame.Rect([0,0,0,0])
rect.bottom = 100
print rect.height

I get :
0

I thought that : Bottom = Top + Height..
Is This correct ? and Why ?
Looks very strange from the outside.

Thanks,
Lionel.