After using this method to find the size of a displayable within my game code, I've found that this works really well with a single terribly annoying exception.
I find that I cannot use this method to find the size of a displayable during init.
When attempt to call a function containing this code during init such as:
Code: Select all
init -10 python:
def make_lcomp(myimage):
myDisplayable = im.Image(myimage)
myRender = renpy.render(myDisplayable, 800, 600, 0, 0)
sizes = myRender.get_size()
return LiveComposite ( sizes, (0,0), myimage)
init:
my_lcomp = make_lcomp("images/myimage.png")
If I were to call this code, I would recieve the error:
AttributeError: 'NoneType' object has no attribute 'frame_time'
I've not been able to find a way around this and it would be kinda rough having to manually enter the sizes of all of the images which I'm trying to use this function for. Is there perhaps a way around this?
lol The poor girl who's doing the data entry part of the manga engine is pretty overworked as it is.