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

[pygame] some tests in simplified Chinese win98se



Ok, some tests on the examples/*.py in simplified Chinese win98se
1. I don't know what is fastevents.py for. After a long time when I pressed
ESC, it exits and shows:
 
0.0
<Clock(fps=0.00)>
total time:32.0699999332
events/second:6236.35797993
 
2. Chinese font problem
There are 2 scripts. fonty_Chinese_bug.py is a modified version form pygame's
fonty.py, and another is fonty_Chinese_right.py
and I tested these 2 scripts on Python 2.3 Enthought Edition build 1028 with
pygame 1.6.2(py23 for short), and movpy 2.4 with
pygame-1.7.1rc3.win32-py2.4.exe( py24 for short)
 
On py23, both fonty_Chinese_bug.py and fonty_Chinese_right.py run. but when I
click in fonty_Chinese_bug.py window, the windows OS gave me a blue screen,
when I press ESC, I got a warning dialog, which said:"PYTHON results in an
invaild page error, in module KERNEL32.DLL at 019f:bff7a138"( sorry, i
translated this from Chinese, so maybe it is not exactly what it should be on
your English windows). fonty_Chinese_right.py runs ok.

On py24, only fonty_Chinese_right.py runs. When launch fonty_Chinese_bug.py,
movpy complains that
[quote]
Traceback (most recent call last):
  File "movpy.py", line 893, in ?
  File "fonty_Chinese_bug.py", line 69

     ^
 SyntaxError: invalid syntax
[/quote]
I don't know it is the problem with movpy or pygame.

3. uberball.py is mentioned in readme.txt, but is missing from the example
fold

4. I don't have pyOpenGL on my py24, so I did not test it. I skipped
overlay.py too because I don't know which file I should feed to it.

5. other *.py run without problem

And some off-topic question:
1. I compose my e-mail in the web-based mail system, it translates SPACE to
&nbsp in the mail title, adds ads at the bottom of the mail, and does not
place the reply in the proper thread( in fact it opens a new thread
everytime). How can I get a more clean and beautiful reply? Which software
should I use?
2. Can I attatch file in my e-mail? what is the size limitation?

[code=fonty_Chinese_bug.py]

"""Here we load a .TTF font file, and display it in
a basic pygame window. It demonstrates several of the
Font object attributes. Nothing exciting in here, but
it makes a great example for basic window, event, and
font management."""


import pygame
from pygame.locals import *


def main():
    #initialize
    pygame.init()
    resolution = 400, 200
    screen = pygame.display.set_mode(resolution)

    #the python 1.5.2 way to set the cursor
    apply(pygame.mouse.set_cursor, pygame.cursors.diamond)
    #the python 2.0 way to set the cursor
    #pygame.mouse.set_cursor(*pygame.cursors.diamond)

    fg = 250, 240, 230
    bg = 5, 5, 5
    wincolor = 40, 40, 90

    #fill background
    screen.fill(wincolor)

    #load font, prepare values
    #font = pygame.font.Font(None, 80)
    font = pygame.font.SysFont(name='ËÎÌå', size=20, bold=0, italic=0)
    text = unicode('ºº×ÖFonty','mbcs')
    size = font.size(text)

    #no AA, no transparancy, normal
    ren = font.render(text, 0, fg, bg)
    screen.blit(ren, (10, 10))

    #no AA, transparancy, underline
    font.set_underline(1)
    ren = font.render(text, 0, fg)
    screen.blit(ren, (10, 40 + size[1]))
    font.set_underline(0)

    #AA, no transparancy, bold
    font.set_bold(1)
    ren = font.render(text, 1, fg, bg)
    screen.blit(ren, (30 + size[0], 10))
    font.set_bold(0)

    #AA, transparancy, italic
    font.set_italic(1)
    ren = font.render(text, 1, fg)
    screen.blit(ren, (30 + size[0], 40 + size[1]))
    font.set_italic(0)

    #show the surface and await user quit
    pygame.display.flip()
    while 1:
        #use event.wait to keep from polling 100% cpu
        if pygame.event.wait().type in (QUIT, KEYDOWN, MOUSEBUTTONDOWN):
            break



if __name__ == '__main__': main()
[/code]
[code=fonty_Chinese_right.py]
import pygame
pygame.init()    
screen=pygame.display.set_mode((300,200))
font = pygame.font.SysFont(name='ËÎÌå', size=20, bold=0, italic=0)
text = unicode('ºº×Ö²âÊÔ','mbcs')
size = font.size(text)
ren = font.render(text, 0,(0xff,0,0,0))
screen.blit(ren, (10, 10))
pygame.display.flip()
while 1:
    if pygame.event.wait().type in (pygame.QUIT, pygame.KEYDOWN,
pygame.MOUSEBUTTONDOWN):
        break
[/code]





--http://www.eyou.com
--Îȶ¨¿É¿¿µÄµç×ÓÐÅÏä  ÓïÒôÓʼþ  Òƶ¯ÊéÇ©  ÈÕÀú·þÎñ  ÍøÂç´æ´¢...ÒÚÓÊδ¾¡

--http://vip.eyou.com
--¿ì¿ìµÇ¼ÒÚÓÊVIPÐÅÏä  ×¢²áÄúÖÐÒâµÄÓû§Ãû

--http://sms.eyou.com
--ÎÞÓǶþ¶þ×å¡¢×ãÇò´ó¸»ÎÌ...¾¡ÔÚÒÚÓʶÌÐÅ