-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem to import .pyx files #145
Comments
You should just be able to import pygame_sdl2 into Ren'Py with. init python:
import pygame_sdl2 |
yes it is true it is already within renpy, however this does not work import pygame_sdl2 as pygame
pygame.import_as_pygame()
pygame._optional_imports()
def main():
# Initialize pygame_sdl2
pygame.init()
pygame.mixer.get_init() |
another problem is display.mode_ok
https://github.com/renpy/pygame_sdl2/blob/master/src/pygame_sdl2/display.pyx#L657 the function is this I don't understand why it gives me this error |
@renpytom Sorry to insist, but I would like to understand if I am making a mistake in using this library or it is a possible implementation. And if so, can I help in any way? (I don't specialize in python, but I work as a programmer) I need to create Renpy minigames that already exist in pygame. this Issue would help me a lot |
That traceback looks like a straight-forward Python error on your end. I'd suggest reviewing the https://www.pygame.org/docs/ref/display.html#pygame.display.list_modes This doesn't appear to be an issue with |
Yes sorry you are right, I don't know why I was passing those parameters. in fact now display works. the only thing is that i think the optional imports are not working. as shown in a previous comment. (although on these imports I am not essential, however if I know there is another way to import this would help me a lot) import pygame_sdl2 as pygame
pygame.import_as_pygame()
pygame._optional_imports()
def main():
# Initialize pygame_sdl2
pygame.init()
pygame.mixer.get_init()
Sorry to ask another question but it's the latest problem I have getting my little pygame to work on renpy that has been bugging me for a while. ie: once i finish the game i don't know how to switch from pygame screen to renpy screen #import basic pygame_sdl2 modules
import pygame_sdl2 as pygame
pygame.import_as_pygame()
pygame._optional_imports()
def main():
# Initialize pygame_sdl2
pygame.init()
screen = pygame.display.set_mode((100,100), 32, 32)
pygame.time.wait(1000)
# * https://github.com/renpy/renpy/issues/4347
# * renpytom tell me to use:
renpy.display_reset() # but not work
# ! BOOM:
renpy.call("start")
return |
Hi, I was trying to import pygame_sdl2 into renpy project.
to do this i downloaded the library from here https://github.com/renpy/pygame_sdl2/tree/master/src/pygame_sdl2 (I failed with pip)
(I tried to follow the read me instructions, but I don't think they are up to date)
this works for py files, but not for pyx files.
checking in the init.py file.
I noticed that the compiler can't find the .pyx libraries.
i know what pyx files are, but i have never developed with it. searching a bit on the internet i realized that i had to add the Cython library,
but nothing changed.
could you give me some suggestions?
The text was updated successfully, but these errors were encountered: