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

[pygame] pygame for 2d graphics



Hi,
 
I am working on a requirement -  developing 2d graphics like lines/rectangles  using pygame.
The original  dimension of one screen and coordinates of components to be drawn  on that screen are in pixels .
My code is  below
-------------------------------------
s = pygame.Surface((4892,3164)) #original dimension of a screen in pixels got from some other application
s.fill((255,255,255))

pygame.draw.aalines(s,(0,0,0),True,[(3000,2500),(3192,2500),(3192,2648),(3000,2648)],0) #original dimensions of a rect
pygame.display.init()
w = pygame.display.set_mode((1000,750))
s1 = pygame.transform.scale(s,(1000,750))
w.blit(s1,(0,0))
pygame.display.flip()
 
done = False
while not done:
 for e in pygame.event.get():
  if e.type == pygame.KEYDOWN:
   done = True
-----------------------------------
 
When i am trying to scale down the original surface to pygame window , the rectangle is not visible.
This is original scalling. I have to provide different scalling levels to provide  zooming effect .
 
What more need to be done to get rectangle visible ?
 
Thanks,
Madhubala