Skip to content

Commit

Permalink
Reduce messagebox minimum width.
Browse files Browse the repository at this point in the history
  • Loading branch information
Francis Herne committed Nov 25, 2014
1 parent 9a8bae0 commit 57870bc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion MessageBox.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@ def draw(self, region):
minwidth = hudimages.MessageBackgroundLeft.get_width() + hudimages.MessageBackgroundRight.get_width()
boxregion.inflate_ip(max(0, minwidth-boxregion.width), 0)

oldclip = self.window.get_clip()
self.window.set_clip(boxregion)
imagewidth = hudimages.MessageBackground.get_width()
horiztileoffset = 0
while horiztileoffset+imagewidth < boxregion.width:
while horiztileoffset < boxregion.width:
self.window.blit(hudimages.MessageBackground, boxregion.move(horiztileoffset, 0))
horiztileoffset += imagewidth
self.window.blit(hudimages.MessageBackgroundLeft, boxregion)
self.window.blit(hudimages.MessageBackgroundRight, boxregion.move(-hudimages.MessageBackgroundRight.get_width(), 0).topright)
self.window.blit(textsurface, textsurface.get_rect(center=region.center))
self.window.set_clip(oldclip)

def update(self):
highestpriority = 0
Expand Down
Binary file modified hud/MessageBackgroundLeft.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified hud/MessageBackgroundRight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 57870bc

Please sign in to comment.