-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
convert_image()
and convert_shape()
methods should support Py5Image, Py5Graphics, and Py5Shape objects
#405
Comments
Adding the good first issue label if anyone wants to work on this. There's a quick fix for this that I'll explain if you're interested. |
Hi; |
Hey @hx2A , |
Hello, @keko24 & @MuhammadHasnain77 ! Thank you both for your interest in fixing this. First, I should give you a heads up that I am dealing with some family health problems right now and might not be as quick to respond as I normally am.
I believe the best way to fix this by modifying this file: py5_resources/py5_module/py5/sketch.py The
Good question! In Processing (Java), the PGraphics class inherits from PImage. Therefore, any PGraphics object is also an instance of PImage. Any method that accepts a PImage object will accept a PGraphics object because the PGraphics object is also a PImage. In py5, the Py5Graphics class does not inherit from Py5Image, and the reasons for this have to do with some details about how py5 works internally. However, the conceptual relationship is the same, and you can pass a Py5Graphics object to any method that would accept a Py5Image object. Since a Py5Graphics object can also be considered a Py5Image object, the However, since the Py5Graphics class does not actually inherit from Py5Image, the code you write cannot be @keko24 & @MuhammadHasnain77 , is all of that understandable? |
Also, to run the build process, look here: https://py5coding.org/developer/build_process.html If there's anything about the build process that is not clear, that's an issue that I will fix. |
thanks |
Hey @hx2A, |
Issue #405: Implemented corresponding changes to convert_image and convert_shape.
When passed Py5Image, Py5Graphics, and Py5Shape objects there is nothing to convert and it should just return the object unmodified without throwing an exception.
The text was updated successfully, but these errors were encountered: