问题遇到的现象和发生背景
问题相关代码,请勿粘贴截图
import pygame
hero_rect = pygame.Rect(100, 500, 120, 125)
pygame.display.set_mode()
print("英雄的原点 %d %d" % (hero_rect.x, hero_rect.y))
print("英雄的尺寸 %d %d" % (hero_rect.width, hero_rect.height))
print("%d %d" % hero_rect.size)
运行结果及报错内容
D:\360setup\python3_8_2\python.exe "D:/BaiduNetdiskWorkspace/python学习课程课件/基础班_1-1到1-4课件/1-4 项目飞机大战/代码/飞机大战/hm_02_使用Rect描述英雄.py"
pygame 2.1.2 (SDL 2.0.18, Python 3.8.2)
Hello from the pygame community. https://www.pygame.org/contribute.html
英雄的原点 100 500
英雄的尺寸 120 125
120 125
进程已结束,退出代码为 0
我的解答思路和尝试过的方法
pygame.Rect(100, 500, 120, 125)分别设置x,y,width,height,但是如何从pygame文件看出pygame.Rect(100, 500, 120, 125)
设置的是x,y,width,height呢?
我想要达到的结果
就如同图片中的那样,不理解讲的是什么?有没有什么资料或者网站讲解如何理解这个的呢?