Python Forum
Sprite on mouse-button hold
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sprite on mouse-button hold
#4
1. This is not a pygame event.
elif pygame.mouse.get_pressed()[0]:
You should be using.
elif event.type == pygame.MOUSEBUTTONDOWN:
    if event.button == 1:
        # rest of code.
2. If you can only highlight one image. Then it doesn't belong in a group.

I would need more code or you explain more what you are doing ?
Sound more like a drag n drop.
99 percent of computer problems exists between chair and keyboard.
Reply


Messages In This Thread
Sprite on mouse-button hold - by Clunk_Head - Oct-07-2019, 02:12 AM
RE: Sprite on mouse-button hold - by Windspar - Oct-07-2019, 11:34 AM
RE: Sprite on mouse-button hold - by Clunk_Head - Oct-08-2019, 04:31 AM
RE: Sprite on mouse-button hold - by Windspar - Oct-09-2019, 12:40 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] Sprite image.get_rect() moves sprite to 0, 0 michael1789 2 4,620 Dec-13-2019, 08:37 PM
Last Post: michael1789
  Sprite not rendering Clunk_Head 2 2,165 Oct-03-2019, 11:27 AM
Last Post: Clunk_Head
  Need help making a sprite GalaxyCoyote 4 3,261 Aug-11-2019, 09:12 PM
Last Post: metulburr
  moving a sprite pfaber11 3 2,619 May-15-2019, 12:52 PM
Last Post: pfaber11
  [PyGame] Need Help With Sprite ghost0fkarma 2 3,303 Jan-09-2018, 02:14 PM
Last Post: ghost0fkarma

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020