Skip to content

Commit

Permalink
Update both pgzhelper and samples of Entry basic
Browse files Browse the repository at this point in the history
  • Loading branch information
JeongJun-Lee committed Jul 7, 2024
1 parent 643f146 commit c3751c5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion mu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
__title__ = "mu-editor"
__description__ = "A simple Python editor for beginner programmers."

__version__ = "1.2.2"
__version__ = "1.2.3"

__license__ = "GPL3"
__url__ = "https://github.com/mu-editor/mu"
Expand Down
8 changes: 4 additions & 4 deletions mu/resources/pygamezero/1_ketma-ketlik.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ def draw():
kuchuk.draw()
mushuk.draw()

kuchuk.say_for_sec("Vov Vov", (200, 20), 2, color='black', background='white')
mushuk.say_for_sec("Miyov", (200, 20), 2, color='black', background='white')
kuchuk.say_for_sec("Yashi boring", (200, 20), 2, color='black', background='white')
mushuk.say_for_sec("Xayr. Salomat bo'ling", (200, 20), 2, color='black', background='white')
kuchuk.say_for_sec("Vov Vov", 2)
mushuk.say_for_sec("Miyov", 2)
kuchuk.say_for_sec("Yashi boring", 2)
mushuk.say_for_sec("Xayr. Salomat bo'ling", 2)

7 changes: 3 additions & 4 deletions mu/resources/pygamezero/2_takrorlash.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
barg.scale = 0.5

def draw():
barg.draw()

def update():
barg.angle += 60
for _ in range(6):
barg.draw()
barg.angle += 60
9 changes: 7 additions & 2 deletions mu/resources/pygamezero/pgzhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1427,10 +1427,15 @@ def get_rect(self):
def say(self, text, size: Tuple[int, int], **kwargs):
ptext.drawbox(text, (self.left - 50, self.top - 50, size[0], size[1]), **kwargs)

def say_for_sec(self, text, size: Tuple[int, int], seconds, **kwargs):
ptext.drawbox(text, (self.left - 50, self.top - 50, size[0], size[1]), **kwargs)
def say_for_sec(self, text, seconds, fgcolor='black', bgcolor='white'):
tsurf, tpos = ptext.drawbox(text, (self.left, self.top - 60, 120, 50),
color=fgcolor, background=bgcolor)
pygame.display.update()
game.time.sleep(seconds)
tsurf.fill(bgcolor)
tsurf.set_alpha(255)
game.screen.blit(tsurf, tpos)
pygame.display.update()

def pen_init(self, size: Tuple[int, int]):
self._tp_surf = pygame.Surface((size[0], size[1]), pygame.SRCALPHA)
Expand Down

0 comments on commit c3751c5

Please sign in to comment.