设为首页收藏本站

Crossin的编程教室

 找回密码
 立即加入
查看: 21545|回复: 1
打印 上一主题 下一主题

【Pygame 第2课】 游戏的本质

[复制链接]

1

主题

0

好友

145

积分

注册会员

Rank: 2

楼主
发表于 2017-3-5 14:03:12 |显示全部楼层
本帖最后由 brahmagupta 于 2017-3-5 14:24 编辑

笔记:
Blit:其意义是将一个平面的一部分或全部图象整块从这个平面复制到另一个平面(位块 传输)
和其他语言里的draw,plot什么的函数名还不太一样(效果一样,都是绘制图形)。

docs中的原文:
BLIT: Basically, blit means to copy graphics from one image to another. A more formal definition is to copy an array of data to a bitmapped array destination. You can think of blit as just "assigning" pixels. Much like setting values in our screen-list above, blitting assigns the color of pixels in our image.

以及screen的参数
Screen CoordinatesTo position an object on the screen, we need to tell the blit() function where to put the image. In pygame we always pass positions as an (X,Y) coordinate. This represents the number of pixels to the right, and the number of pixels down to place the image. The top-left corner of a Surface is coordinate (0, 0). Moving to the right a little would be (10, 0), and then moving down just as much would be (10, 10). When blitting, the position argument represents where the topleft corner of the source should be placed on the destination.
所以这个坐标值 应该是以左上角为像素原点
回复

使用道具 举报

1

主题

0

好友

145

积分

注册会员

Rank: 2

沙发
发表于 2017-3-5 14:16:28 |显示全部楼层
好吧 也有pygame.draw。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即加入

QQ|手机版|Archiver|Crossin的编程教室 ( 苏ICP备15063769号  

GMT+8, 2024-5-5 12:47 , Processed in 0.025841 second(s), 21 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部