想想现在学校pygame有几个钟了,就写了一个小程序:图片代替鼠标移动
程序的运行效果:
当鼠标移动到窗口内,鼠标不见了,取而代之的是图片.....
代码部分:
pygame.locals *
sys
= { : : : : :
BG_IMAGE =
MOUSE_IMAGE =
screen = pygame.display.set_mode((500,500),32 pygame.display.set_caption(
bg = mouse_cursor =
event event.type ==
x,y =
x -= mouse_cursor.get_width() / 2
y -= mouse_cursor.get_height() / 2
pygame.display.update()
========================================================
More reading,and english is important.
I'm Hongten
<pre class="code"><span style="font-size: 16px; color: #ff0000;">大哥哥大姐姐,觉得有用打赏点哦!多多少少没关系,一分也是对我的支持和鼓励。谢谢。Hongten博客排名在100名以内。粉丝过千。Hongten出品,必是精品。
E | hongtenzone@foxmail.com B |
========================================================