我是 python 的初学者程序员,最近开始使用 tkinter,尽管我遇到了一个我无法解决的问题。
基本上我有两个输入框。
(这只是我需要的一个例子。)
我需要的是一个for循环标签弹出和闪烁entry1
的很多次entry2
,是的,我知道如何让进入输入,但我不知道如何让标签,不断闪烁,我曾尝试pack_forget
与.destroy
该方法标签在一个循环中,但不幸的是它没有显示,因为它几乎立即再次从屏幕上清除它。
我最近开始使用pygame看看我能想出什么并遇到一个问题,如果没有这个pygame.sprite.Sprite和rect事情,我找不到答案,我的问题是如何找到一个位置因为我需要它的位置来计算旋转角度.如果它有帮助,这是我正在使用的代码:
import sys, pygame, math, time;
from pygame.locals import *;
spaceship = ('spaceship.png')
mouse_c = ('crosshair.png')
backg = ('background.jpg')
fire_beam = ('beam.png')
pygame.init()
screen = pygame.display.set_mode((800, 600))
bk = pygame.image.load(backg).convert_alpha()
mousec = pygame.image.load(mouse_c).convert_alpha()
space_ship = pygame.image.load(spaceship).convert_alpha()
f_beam = pygame.image.load(fire_beam).convert_alpha()
clock = pygame.time.Clock()
pygame.mouse.set_visible(False)
space_ship_rect = space_ship.get_rect() #added
while True:
screen.blit(bk, (0, 0))
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
elif event.type == MOUSEBUTTONDOWN and event.button == 1:
print("Left Button Pressed")
elif event.type == MOUSEBUTTONDOWN and event.button == …
Run Code Online (Sandbox Code Playgroud)