pygame_sdl2 icon indicating copy to clipboard operation
pygame_sdl2 copied to clipboard

Can you add the pygame.mask Submodule

Open dominoxp opened this issue 10 years ago • 7 comments

I'm trying to convert my game written in pygame into an android Aplication using your libraries and Project. The problem is, that i need the pygame.mask, which doesn't seems to be implemented yet. I would be very pleased if you can add it to your Project. Thank you

dominoxp avatar Aug 17 '15 08:08 dominoxp

Will do.

renpytom avatar Aug 17 '15 12:08 renpytom

@renpytom

This is a problem I am having: pygame.mask is needed. I am using the modules PyTMX & PyScroll by bitcraft (https://github.com/bitcraft) which need the mask submodule to do some very basic functions.

As far as I can tell everything else works good.

mclaughlinconnor avatar Dec 24 '16 21:12 mclaughlinconnor

Which functions do you need? I looked at it this morning, and there is a lot of stuff there.

renpytom avatar Dec 24 '16 21:12 renpytom

@renpytom

I apologise if this is a bad reply but my knowledge of Python isn't great. I think I need pygame.sprite.LayeredUpdates. The error pygame_sdl2 spits out is NotImplementedError: Could not import pygame_sdl2.sprite: No module named mask

If this isn't good enough here is my logcat:

Android bootstrap done. __name__ is __main__ Run user program, change dir and execute main.py Opening APK '/data/app/com.connor.gtc-1/base.apk' jpeg_decoder mode 0, colorType 4, w 3648, h 5472, sample 1, bsLength 0!! jpeg_decoder mode 1, colorType 4, w 3648, h 5472, sample 2, bsLength 0!! Traceback (most recent call last): File "main.py", line 40, in <module> import pyscroll File "lib/pyscroll/__init__.py", line 26, in <module> from .group import * File "lib/pyscroll/group.py", line 14, in <module> class PyscrollGroup(pygame.sprite.LayeredUpdates): File "/data/user/0/com.connor.gtc/files/lib/python2.7/site-packages/pygame_sdl2/__init__.py", line 32, in __getattr__ raise NotImplementedError(self.reason) NotImplementedError: Could not import pygame_sdl2.sprite: No module named mask Python for android ended.

If this still isn't good enough just tell me what you need.

Thanks a lot. -Connor

Edit: Upon further inspection I realise pygame.sprite.LayeredUpdates is included.

Edit2: After furtherer inspection I can't even find the mask submodule anywhere in Pygame. This could just be me being silly or there's something funny going on.

Edit3: After furthererer inspection using cat */*.py | grep mask I found that pygame.mask.Mask + pygame.mask.from_surface are being used.

mclaughlinconnor avatar Dec 26 '16 17:12 mclaughlinconnor

@renpytom

Any news?

mclaughlinconnor avatar Jan 02 '17 11:01 mclaughlinconnor

@renpytom

Is this still on-going? Or has development on the module stopped? Because I too am trying to use bitcraft's PyTMX module. I have tried to port the pygame.mask.from_surface, to no avail.

DaveMcGr avatar Feb 13 '17 16:02 DaveMcGr

Hello~~. I'm the author of pytmx and pyscroll. I'll investigate if I could possibly not require the mask module, or optimize it for pygame_sdl2.

https://github.com/bitcraft/PyTMX/issues/78

bitcraft avatar Mar 16 '17 15:03 bitcraft