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

Method __init__

brainworkshop.py:2489–2513  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2487# this class controls the visual cues (colored squares).
2488class Visual:
2489 def __init__(self):
2490 self.visible = False
2491 self.label = pyglet.text.Label(
2492 '',
2493 font_size=field.size//6, bold=True,
2494 anchor_x='center', anchor_y='center', batch=batch)
2495 self.variable_label = pyglet.text.Label(
2496 '',
2497 font_size=field.size//6, bold=True,
2498 anchor_x='center', anchor_y='center', batch=batch)
2499
2500 self.spr_square = [pyglet.sprite.Sprite(pyglet.image.load(path))
2501 for path in resourcepaths['misc']['colored-squares']]
2502 self.spr_square_size = self.spr_square[0].width
2503
2504 if cfg.ANIMATE_SQUARES:
2505 self.size_factor = 0.9375
2506 elif cfg.OLD_STYLE_SQUARES:
2507 self.size_factor = 0.9375
2508 else:
2509 self.size_factor = 1.0
2510 self.size = int(field.size / 3 * self.size_factor)
2511
2512 # load an image set
2513 self.load_set()
2514
2515 def load_set(self, index=None):
2516 if type(index) == int:

Callers

nothing calls this directly

Calls 1

load_setMethod · 0.95

Tested by

no test coverage detected