mirror of
https://git.cavemanon.xyz/Cavemanon/SnootGame.git
synced 2025-02-24 10:38:56 +01:00
No children, only child
This commit is contained in:
parent
2a79673d09
commit
b586e8f4e9
1 changed files with 15 additions and 12 deletions
|
@ -29,17 +29,17 @@ init python:
|
|||
SMALL_SPACING = (LARGE_SPACING[0]//2, LARGE_SPACING[1]//2)
|
||||
|
||||
class LangButton(renpy.Displayable):
|
||||
def __init__(self, v, w, h, *childs, **kwargs):
|
||||
def __init__(self, v, w, h, child, **kwargs):
|
||||
super(LangCave.LangButton, self).__init__(**kwargs)
|
||||
|
||||
self.childs = []
|
||||
#self.childs = []
|
||||
|
||||
for ch in childs:
|
||||
child = renpy.displayable(ch)
|
||||
self.childs.append(child)
|
||||
self.child = renpy.displayable(child)
|
||||
# self.childs.append(child)
|
||||
|
||||
self.width = w
|
||||
self.height = h
|
||||
|
||||
self.width = 0#w
|
||||
self.height = 0#h
|
||||
self.value = v
|
||||
self.hover = True #renpy can't handle not/!
|
||||
self.selected = False
|
||||
|
@ -54,10 +54,13 @@ init python:
|
|||
if (LangCave.on_disable_interactable == False and self.selected):
|
||||
args = {}
|
||||
|
||||
for ch in self.childs: #draw every child
|
||||
t = Transform(child=ch, **args)
|
||||
child_render = renpy.render(t, self.width, self.height, st, at)
|
||||
root_render.blit(child_render, (0, 0))
|
||||
#force rendering to get width and height
|
||||
self.width, self.height = renpy.render(Transform(child=self.child), 0, 0, 0.0, 0.0).get_size()
|
||||
#for ch in self.childs: #draw every child
|
||||
t = Transform(child=self.child, **args)
|
||||
child_render = renpy.render(t, self.width, self.height, st, at)
|
||||
root_render.blit(child_render, (0, 0))
|
||||
|
||||
|
||||
return root_render
|
||||
|
||||
|
@ -88,7 +91,7 @@ init python:
|
|||
renpy.redraw(self, 0)
|
||||
|
||||
def visit(self):
|
||||
return self.childs
|
||||
return [self.child]
|
||||
|
||||
@staticmethod
|
||||
def render():
|
||||
|
|
Loading…
Reference in a new issue