Render a message glyph. Clears the area beneath the message first and assumes the display will be paused afterwards.
(session, window, msg, x, y)
| 500 | |
| 501 | |
| 502 | def render_message(session, window, msg, x, y): |
| 503 | """Render a message glyph. |
| 504 | |
| 505 | Clears the area beneath the message first |
| 506 | and assumes the display will be paused |
| 507 | afterwards. |
| 508 | |
| 509 | """ |
| 510 | # create message box |
| 511 | msg = GlyphCoordinate(session, msg, x, y) |
| 512 | |
| 513 | # clear existing glyphs which intersect |
| 514 | for gly in ( |
| 515 | session.query(GlyphCoordinate) |
| 516 | .join(GlyphCoordinate.glyph) |
| 517 | .filter(GlyphCoordinate.intersects(msg)) |
| 518 | ): |
| 519 | gly.blank(window) |
| 520 | |
| 521 | # render |
| 522 | msg.render(window, {}) |
| 523 | window.refresh() |
| 524 | return msg |
| 525 | |
| 526 | |
| 527 | def win(session, window, state): |