MCPcopy Create free account
hub / github.com/brain-workshop/brainworkshop / __init__

Method __init__

brainworkshop.py:664–680  ·  view source on GitHub ↗
(self, msg)

Source from the content-addressed store, hash-verified

662messagequeue = [] # add messages generated during loading here
663class Message:
664 def __init__(self, msg):
665 if not 'window' in globals():
666 print(msg) # dump it to console just in case
667 messagequeue.append(msg) # but we'll display this later
668 return
669 self.batch = pyglet.graphics.Batch()
670 self.label = pyglet.text.Label(msg,
671 font_name=self.fontlist_serif,
672 color=cfg.COLOR_TEXT,
673 batch=self.batch,
674 multiline=True,
675 width=(4*window.width)/5,
676 font_size=calc_fontsize(14),
677 x=width_center(), y=height_center(),
678 anchor_x='center', anchor_y='center')
679 window.push_handlers(self.on_key_press, self.on_draw)
680 self.on_draw()
681
682 def on_key_press(self, sym, mod):
683 if sym:

Callers

nothing calls this directly

Calls 4

on_drawMethod · 0.95
calc_fontsizeFunction · 0.85
width_centerFunction · 0.85
height_centerFunction · 0.85

Tested by

no test coverage detected