Skip to content

Add theme options to place button images on button surface relative to button #145

Open
@Ztaoxx

Description

@Ztaoxx

Describe the bug
I'm trying to draw a image on a button with .image or .set_image attributes but they neither works, with .image i have TypeError:
TypeError: 'pygame.Surface' object is not callable

To Reproduce
Steps to reproduce the behaviour:

  1. Create a button
  2. Draw a button on a screen
  3. Set a Image

Platform and software (please complete the following information):

  • OS: Windows 10
  • Pygame GUI version Newest One
  • Pygame version Newest One

Additional context
Code:
self.draw = pygame_gui.elements.UIButton(pygame.Rect((self.x, self.y), (150, 40)), self.text, self.manager,
None, self.text_tip)
self.draw.set_image(screen,'LVLUP.bmp')
or:
self.draw = pygame_gui.elements.UIButton(pygame.Rect((self.x, self.y), (150, 40)), self.text, self.manager,
None, self.text_tip)
self.draw.image(screen,'LVLUP.bmp')

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions