Is there any way to do this in Renpy? (Or Python?) Plus I want to save the image the player makes in the persistent data so the game can pull it up later.
Either have the player draw an image themselves(like in Paint but of course only a black line) or click (or drag?) shapes to create something on a canvas.
I'm not that good with coding yet(my second 'big' game) so I decided to ask here to see if it is possible within the timeframe I have. (I do have a plan B luckily to simplify it to a choice menu, but that's less fun for the player..)
Thanks for reading >-<
Is it possible to create a simple drawing minigame?
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.
-
- Newbie
- Posts: 3
- Joined: Wed Jan 10, 2018 1:19 pm
- Tumblr: Moonmonologue
- Contact:
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3794
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Is it possible to create a simple drawing minigame?
It might be possible with the python paint module
http://www.object-craft.com.au/projects ... mples.html
I see no reason why it can't be done somehow. After all, the 'free photoshop' program 'Gimp' is powered by Python, albeit at a more complex level than the paint module
http://www.object-craft.com.au/projects ... mples.html
I see no reason why it can't be done somehow. After all, the 'free photoshop' program 'Gimp' is powered by Python, albeit at a more complex level than the paint module
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
-
- Newbie
- Posts: 3
- Joined: Wed Jan 10, 2018 1:19 pm
- Tumblr: Moonmonologue
- Contact:
Re: Is it possible to create a simple drawing minigame?
Thank you so much! This is a good start to try figuring it out.Imperf3kt wrote: ↑Wed Jan 24, 2018 8:40 pm It might be possible with the python paint module
http://www.object-craft.com.au/projects ... mples.html
I see no reason why it can't be done somehow. After all, the 'free photoshop' program 'Gimp' is powered by Python, albeit at a more complex level than the paint module
I tried importing the code(I threw the module in both a folder called paint and the files in the game directory to see if it was a reference issue), but it gave me this error:
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 97, in script
init python:
File "game/script.rpy", line 98, in <module>
import paint
ImportError: No module named paint
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/script.rpy", line 97, in script
init python:
File "C:\Users\Gebruiker\Desktop\renpy-6.99.14-sdk\renpy\ast.py", line 848, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "C:\Users\Gebruiker\Desktop\renpy-6.99.14-sdk\renpy\python.py", line 1804, in py_exec_bytecode
exec bytecode in globals, locals
File "game/script.rpy", line 98, in <module>
import paint
ImportError: No module named paint
Windows-8-6.2.9200
Ren'Py 6.99.14.3135
testing 1.0
Code: Select all
label normal:
$ persistent.second = False
# this persistent is not important lol it is to test a mainmenu screenswap
scene black
"Let's draw something!"
init python:
import paint
image = paint.image(100, 80)
image.stroke(paint.line(10, 10, 90, 70).dash(0, (10, 5)), paint.rgb(0xff,0,0), 10)
rect = paint.rect(20, 10, 70, 50)
image.fill(rect, paint.rgb(0xff,0xff,0))
image.stroke(rect, paint.rgb(0,0xff,0), 5)
image.stroke(paint.arc(10, 20, 60, 70, 270, 180), paint.rgba(0,0,0xff,0x40), 5)
arial = paint.font('arial.ttf', 24, 30)
image.text(arial, 15, 70, paint.rgb(0,0,0), 'Hooray')
image.write_png('intro.png')
"This was a succes!"
label next:
scene black
- Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
- Contact:
Re: Is it possible to create a simple drawing minigame?
Paint uses C files as a platform base, so is not easy to use inside Ren'py (you would need to bundle the C code and dependencies inside the Ren'py core and recompile, making sure the C code was compatible for all platforms that Ren'py runs on - pretty complex stuff and, even if you got it working it would need to be done for every new release if you upgraded Ren'py)
Most people, if they import external python modules, tend to choose only those that have pure python implementations and few dependencies.
Though there are a few options using Ren'py's Image classes (you could basically track various clicks/choices and compose a composite image using numerous overlay images - still pretty complex, more likely to work than using C code though) you might do better just trying to implement a pygame paint program inside your script.
Realistically though, there is no easy way to do what you want and every option will require a good level of programming experience or familiarity with Ren'py.
Most people, if they import external python modules, tend to choose only those that have pure python implementations and few dependencies.
Though there are a few options using Ren'py's Image classes (you could basically track various clicks/choices and compose a composite image using numerous overlay images - still pretty complex, more likely to work than using C code though) you might do better just trying to implement a pygame paint program inside your script.
Realistically though, there is no easy way to do what you want and every option will require a good level of programming experience or familiarity with Ren'py.
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
- ComputerArt.Club
- Veteran
- Posts: 427
- Joined: Mon May 22, 2017 8:12 am
- Completed: Famous Fables, BoPoMoFo: Learn Chinese, Santa's workshop, Cat's Bath, Computer Art Club
- Location: Taiwan
- Contact:
Re: Is it possible to create a simple drawing minigame?
Were you successful in doing this? This is something I have often wanted to do myself. If someone succeeds, a cookbook entry would be awesome or any kind of simple run through of what worked for you.
Facebook:
Renpy Creators and Enthusiasts Facebook Group
My latest game:
Famous Fables: Read, Learn and Play - Android App for teaching children to read
Creative Commons stuff:
Shape transitions,
100+ 360° photos of Japan,
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot]