Hello comrades,
I have a bit of in interesting issue here. I am trying to show characters (as imagebuttons) in different locations with adaptive scaling. Meaning that for example, if you're in a small room the character is larger (closer), while outdoors they are smaller. I am trying to write general code for this so it works for any character. This is already in a nested loop, so I'll cut that out since I don't think it is relevant to my question:
imagebutton:
yalign 1.0
idle im.Scale(z.name + "_" + y.EM_Active, SubLocations[SubLocationID].scale*default_scale_x, SubLocations[SubLocationID].scale*default_scale_y)
hover z.name + "_" + y.EM_Active
action Jump(z.name + "_Passive")
The exact positioning and scaling according to the location is defined in the SubLocations class, which is used here to calculate the width and height scaling needed in im.Scale.
The image meant to be shown is already defined as a Ren'Py image. For example: John_Wifebeater would be an image of character "John" (z.name) in his outfit "Wifebeater" (y.EM_Active), defined as image John_Wifebeater = "/path/...." in another file.
The hover option works, but obviously doesn't show the required scaling. Is it possible to use im.Scale with already defined images? Above code gives this error:
"IOError couldn't find file 'John_Wifebeater'.
So I guess it doesn't recognize that there is an image defined with this name...
Any help is appreciated
I have a bit of in interesting issue here. I am trying to show characters (as imagebuttons) in different locations with adaptive scaling. Meaning that for example, if you're in a small room the character is larger (closer), while outdoors they are smaller. I am trying to write general code for this so it works for any character. This is already in a nested loop, so I'll cut that out since I don't think it is relevant to my question:
imagebutton:
yalign 1.0
idle im.Scale(z.name + "_" + y.EM_Active, SubLocations[SubLocationID].scale*default_scale_x, SubLocations[SubLocationID].scale*default_scale_y)
hover z.name + "_" + y.EM_Active
action Jump(z.name + "_Passive")
The exact positioning and scaling according to the location is defined in the SubLocations class, which is used here to calculate the width and height scaling needed in im.Scale.
The image meant to be shown is already defined as a Ren'Py image. For example: John_Wifebeater would be an image of character "John" (z.name) in his outfit "Wifebeater" (y.EM_Active), defined as image John_Wifebeater = "/path/...." in another file.
The hover option works, but obviously doesn't show the required scaling. Is it possible to use im.Scale with already defined images? Above code gives this error:
"IOError couldn't find file 'John_Wifebeater'.
So I guess it doesn't recognize that there is an image defined with this name...
Any help is appreciated