Sunday, July 7, 2024

Python Error (Renpy) : TypeError: 'str' object is not callable

Met an error in renpy when writing the action function of an image button like below :
 action Function( '\u2192', pygame.K_RIGHT)

Error shown as below : 
File "renpy/common/00action_other.rpy", line 583, in __call__

    rv = self.callable(*self.args, **self.kwargs)

TypeError: 'str' object is not callable

Forgot to add the function name 
Corrected the syntax to below (also added the parameter name to before value):
action Function(simulate_keypress, unicode_key='\u2192', pygame_key=pygame.K_RIGHT)


No comments:

Post a Comment

Migrating from Renpy to Godot

 Due to the limitation of renpy in rendering dynamic screen ,  due the the black border it gives in different UI scale resolution , finally ...