[python] Obecná rada

Tomy Novella tomasnovella na gmail.com
Pátek Červen 27 15:26:36 CEST 2008


no predsa len ostavam pri pyGame ;-))

mal by som vsak este par otazok na neho:

v jednom tutoriali-http://www.pygame.org/docs/tut/MoveIt.html- bolo napisane:
-----
    >>> player = pygame.image.load('player.bmp').convert()
    >>> background = pygame.image.load('liquid.bmp').convert()

We can see that's pretty simple, the load function just takes a
filename and returns a new Surface with the loaded image. After
loading we make a call to the Surface method, convert(). Convert
returns us a new Surface of the image, but now converted to the same
pixel format as our display. Since the images will be the same format
at the screen, they will blit very quickly. If we did not convert, the
blit() function is slower, since it has to convert from one type of
pixel to another as it goes.
-----
co to znamena, ze je to skonvertovane do "the same pixel format as our
display" ??
a co je vlastne Ten display? je to nieco, ako ta najspodnejsia
vrstva(napr. vo Photoshope?) a potom tie Surfaces su akoby vrstvy nad
tym?pozeral som aj http://www.geon.wz.cz/pygame/tut/moveit/moveit.html
(Geonov prepis do cestiny) ale mudrejsi z toho niesom ;(

dalsia otazka k pygame(a zrejme ku vsetkych GUI knizniciam vseobecne):
je rozdiel, ci napisem
pygame.time.delay(100) alebo
time.sleep(0.1)
?
nieco mi hovori, ze sa ma preferovat prvy sposob(ved inak by
nevznikol) ale preco?


Další informace o konferenci Python