I was searching for something like a drawing system for Renpy.
So I found this post: viewtopic.php?t=51370
And this code: https://github.com/jsfehler/renpy-freehand-draw
I adjusted a few things, and it works nice.
But there are a few problems.
The first thing is that sometimes when you draw a full circle it doesn't matter if you choose something else, the game keeps only letting you draw the circle.
Another problem is that if your drawing "touches" the edges of the screen, it also "goes crazy". It won't stop drawing straight lines.
And the other problem is that I couldn't make a "undo" button. If the person makes a mistake, they have to draw it all again.
I changed the code a bit, and added more colors. I also made it vertical, since my game is vertical.
I wanted to add another line of colors but I couldn't either
Does anyone know how I can fix at least one of those things
Here is what I did (project):
https://drive.google.com/open?id=1lDiJC ... kETN88OkwZ
I wanted to add more colors and these options: "undo", "clear", "leave" like that.
Also, I tried changing the images (icons) of the lines, circle, etc. But the game didn't change it
I wanted them to look a little bigger.
Thanks
Drawing system in Renpy?
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Drawing system in Renpy?
I can't access my other account cause I don't remember the e-mail I used *cries in emoji*.
- Wight
- Regular
- Posts: 47
- Joined: Mon Jan 07, 2019 5:40 pm
- Completed: A Transient Experiment
- itch: wight
- Contact:
Re: Drawing system in Renpy?
I might have an idea why it's not working as expected for you, I've ran into similar issues when changing it around for my NaNoRenO project.
I have some solutions to your issues and only some workarounds.
However, it seems like this is only an issue if you're playing this in windowed mode, fullscreen mode doesn't seem to have this issue as far as I can tell.
The way it draws is really simple and limited anyway. With the way it's set up right now, I'd only expect doodles to be made and nothing too serious. There's real drawing programs the player can use for serious art.
For those last two issues, I edited your script file to fix it and included a few #notes: And for comparison's sake, this is how I made it look in my version.
https://i.imgur.com/sKdRGXm.png
It still has some of the same issues you do that I couldn't solve, but I find that it's far less likely to happen when set up like this. I don't know how important it is for you to keep it that big, but you might have to consider shrinking down the canvas by a lot.
I have some solutions to your issues and only some workarounds.
This happens when you hold down your mouse, and then release it while it's over another button. Let's say doing this confuses the game and makes it think you're trying to use two buttons at once. I can't offer a solution to this, my workaround was to space the buttons far away from the canvas to prevent this from happening.
It's not a solution, but what I ended up doing was shrinking the canvas by a lot so that the edges of the canvas are far away from the edge of the window.
However, it seems like this is only an issue if you're playing this in windowed mode, fullscreen mode doesn't seem to have this issue as far as I can tell.
I couldn't figure out how to get this working either. The player just has to use the white color as an eraser to fix an error.
The way it draws is really simple and limited anyway. With the way it's set up right now, I'd only expect doodles to be made and nothing too serious. There's real drawing programs the player can use for serious art.
You'll probably need to make a second hbox for this one.
Your new icons are in a subfolder. Which means you either need to make the new icons overwrite the current ones, or change the code to look for "Nova pasta/pencil_icon.png" instead.
For those last two issues, I edited your script file to fix it and included a few #notes: And for comparison's sake, this is how I made it look in my version.
https://i.imgur.com/sKdRGXm.png
It still has some of the same issues you do that I couldn't solve, but I find that it's far less likely to happen when set up like this. I don't know how important it is for you to keep it that big, but you might have to consider shrinking down the canvas by a lot.
Re: Drawing system in Renpy?
Oh, thank you so much for all the explanation.Wight wrote: ↑Thu Mar 21, 2019 4:16 am I might have an idea why it's not working as expected for you, I've ran into similar issues when changing it around for my NaNoRenO project.
I have some solutions to your issues and only some workarounds.
This happens when you hold down your mouse, and then release it while it's over another button. Let's say doing this confuses the game and makes it think you're trying to use two buttons at once. I can't offer a solution to this, my workaround was to space the buttons far away from the canvas to prevent this from happening.
It's not a solution, but what I ended up doing was shrinking the canvas by a lot so that the edges of the canvas are far away from the edge of the window.
However, it seems like this is only an issue if you're playing this in windowed mode, fullscreen mode doesn't seem to have this issue as far as I can tell.
I couldn't figure out how to get this working either. The player just has to use the white color as an eraser to fix an error.
The way it draws is really simple and limited anyway. With the way it's set up right now, I'd only expect doodles to be made and nothing too serious. There's real drawing programs the player can use for serious art.
You'll probably need to make a second hbox for this one.
Your new icons are in a subfolder. Which means you either need to make the new icons overwrite the current ones, or change the code to look for "Nova pasta/pencil_icon.png" instead.
For those last two issues, I edited your script file to fix it and included a few #notes:
script.rpy
And for comparison's sake, this is how I made it look in my version.
https://i.imgur.com/sKdRGXm.png
It still has some of the same issues you do that I couldn't solve, but I find that it's far less likely to happen when set up like this. I don't know how important it is for you to keep it that big, but you might have to consider shrinking down the canvas by a lot.
Since my game simulates a phone, I thought that would be nice to add this as a "tool".
I'll give a look at the code.
Thank you
I can't access my other account cause I don't remember the e-mail I used *cries in emoji*.
Who is online
Users browsing this forum: Ahrefs [Bot]