-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Add Functionality to Easily Add Images to J-Objects #388
Comments
Would it be better if we create a separate Another thought unrelated to this issue: |
Yes I think that makes sense. Having the functionality for all shapes shouldn't be too complicated as well. We probably want to restructure some parts to avoid writing the same code over and over. Creating more functionality by using JShape internally sounds like a good idea too |
I like the idea of a
Where the function is defined like: function JImage(center::Point, radius::Real, clipshape, img)
clipshape(center, radius, :clip)
placeimage(img, center, centered = true)
end When you say that
Or what were you imagining/envisioning @Sov-trotter ? |
I will be hard to generalize eg: function JImage(pos::Point, img)
placeimage(img, center, centered = true)
end |
We might want to have a vector of those convenience methods in the future. That way we could say |
Created a potential implementation of ideas here! Feel free to review that PR. |
Is your feature request related to a problem? Please explain.
After some fun experiments today, I realized that we do not have a way to easily add images to J-Objects!
Describe the solution you'd like
Here is the syntax I created for a function call:
JCircle(dog_positions[i], 27; img = readpng("tiny_doggo.png"))
Then, here is what I changed in base Javis to the
JCircle
function:and here is the internal method:
Describe alternatives you've considered
I considered writing an external function outside of Javis to do this, but it felt like too much work for such a small new feature addition. Then, I thought about creating a new base Javis function. That didn't make much sense as it is not much different from the base
JCircle
J-Object implementation. So, I added it to the base JavisJCircle
definition.What do you think @Wikunia and @Sov-trotter ? I tested out the above changes and none of the tests we had in place failed using this new functionality.
The text was updated successfully, but these errors were encountered: