self._widgets = []
cmn = self._common_btn.copy() | {
'frameSize': (-2.4, 2.4, -2.4, 2.4),
- 'frameColor': (1, 1, 1, .8)}
+ 'frameColor': (1, 1, 1, .8),
+ 'text_scale': .64}
left = - (dx := .8) * (min(3, len(scenes)) - 1) / 2
for i, cls in enumerate(scenes):
top = .1 if len(scenes) < 4 else .6
row = 0 if i < 3 else 1
self._widgets += [DirectButton(
text=cls.name(), pos=(left + dx * (i % 3), 1, top - dx * row),
- command=self.start, extraArgs=[cls], text_wordwrap=4,
+ command=self.start, extraArgs=[cls], text_wordwrap=6,
frameTexture='assets/images/scenes/%s.png' % cls.__name__,
**cmn)]
+ for j in range(4):
+ tnode = self._widgets[-1].component('text%s' % j).textNode
+ height = - tnode.getLineHeight() / 2
+ height += (tnode.get_height() - tnode.get_line_height()) / 2
+ self._widgets[-1].component('text%s' % j).set_pos(0, 0, height)
self._widgets += [DirectButton(
text=_('Back'), pos=(0, 1, -.8), command=self.on_back,
**self._common_btn)]