draft tutorial revisions
This commit is contained in:
parent
838da4571d
commit
48359b5a48
70 changed files with 6216 additions and 28 deletions
27
docs/cookbook/ui/ui_message_log_enhanced.py
Normal file
27
docs/cookbook/ui/ui_message_log_enhanced.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
"""McRogueFace - Message Log Widget (enhanced)
|
||||
|
||||
Documentation: https://mcrogueface.github.io/cookbook/ui_message_log
|
||||
Repository: https://github.com/jmccardle/McRogueFace/blob/master/docs/cookbook/ui/ui_message_log_enhanced.py
|
||||
|
||||
This code is extracted from the McRogueFace documentation and can be
|
||||
run directly with: ./mcrogueface path/to/this/file.py
|
||||
"""
|
||||
|
||||
def handle_keys(key, state):
|
||||
if state != "start":
|
||||
return
|
||||
|
||||
if key == "PageUp":
|
||||
log.scroll_up(5)
|
||||
elif key == "PageDown":
|
||||
log.scroll_down(5)
|
||||
|
||||
mcrfpy.keypressScene(handle_keys)
|
||||
|
||||
# Or with mouse scroll on the frame
|
||||
def on_log_scroll(x, y, button, action):
|
||||
# Note: You may need to implement scroll detection
|
||||
# based on your input system
|
||||
pass
|
||||
|
||||
log.frame.click = on_log_scroll
|
||||
Loading…
Add table
Add a link
Reference in a new issue