Drawing using mouse on a restricted part of the screen?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
Rakuran
Newbie
Posts: 5
Joined: Fri Aug 10, 2018 9:16 pm
Contact:

Drawing using mouse on a restricted part of the screen?

#1 Post by Rakuran »

Hello!
I'd love to get some advice on this. I'm preparing a VN for my thesis (it's supposed to help learning Japanese), and with roughly three weeks left, I have to reconsider using another engine just to have the part below done (hopefully it's possible also in Renpy, but I have no idea - that's why I'm asking).
Is creating a canvas that takes only a part of the screen possible? If yes, is it possible for player to write on it (using mouse coordinates and in a manner similar to drawing in MS Paint) until the player connects the dots representing a sign? I did a few mockups (these are not screenshots, just photoshop) to show what I have on my mind (and yes, I'm shamelessly using Sylvie as a placeholder).
https://imgur.com/WZuVBv0.png
https://imgur.com/ovlz6Hb.png
https://imgur.com/CT2MUyl.png
https://imgur.com/4twD96w.png
https://imgur.com/ghAXeJn.png
https://imgur.com/oKuCfBn.png
https://imgur.com/kzQeTrM.png

I need my game to incorporate hiragana writing practice, and I can't come up with any simpler idea than dot connecting within a certain trace. Ideally, I'd like the player to draw with the trace being visible a few times, then one time after the trace disappears. Is there any chance to do something like this in Renpy? That whole part with possibility to draw with mouse only in that restricted white area (and not having to draw continuously, but until the red dots are connected) is the most important thing though. I'm guessing I'll need some sort of separate layer for the dots, but I don't even know how to prepare a canvas similar to that in mockup pictures (to be honest, I have no idea how to prepare any canvas), and being able to write on it is a mystery for me too ;_;

To sum up:
1. Can the player draw on a restricted area at all?
2. Can the player draw on that area until he/she connects all the dots?
3. Can the game check if the dots are connected correctly only after the player connects all of them? (I'm guessing yes but asking just to be sure)
4. Can the game check if the player has drawn anything outside the trace (last pic provides wider, purple trace which I'd like to use when making the player write without the trace being visible - of course, that purple trace would be invisible too) and, basing on that and dot connecting order, show the player the result (correct/try again)?

I'll be immensely happy with any help!

User avatar
Kia
Eileen-Class Veteran
Posts: 1039
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: Drawing using mouse on a restricted part of the screen?

#2 Post by Kia »

yes, you can create lots of little buttons as square pixels and make them change alpha with a transition, however forcing the player to draw with mouse is a terrible idea, it's very frustrating and never comes out right, I suggest creating a minigame that works like a wire loop game instead

Rakuran
Newbie
Posts: 5
Joined: Fri Aug 10, 2018 9:16 pm
Contact:

Re: Drawing using mouse on a restricted part of the screen?

#3 Post by Rakuran »

Thanks for the reply!
Huh, wire loop game looks interesting, but I have no idea how it works D:

Post Reply

Who is online

Users browsing this forum: Google [Bot]