Drag Mobile Phone to take Photo
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.
Drag Mobile Phone to take Photo
Hi all, please there is somewhere an example of how to drag my Phone screen with mouse to take photo and maybe zoom with mouse wheel? Thanks in advance.
- Andredron
- Miko-Class Veteran
- Posts: 535
- Joined: Thu Dec 28, 2017 2:37 pm
- Completed: Kimi ga nozomu renpy-port(demo), Albatross Koukairoku(demo)
- Projects: Sisters ~Natsu no Saigo no Hi~(renpy-port)
- Location: Russia
- Contact:
Re: Drag Mobile Phone to take Photo
I'm writing a Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18
Help me to register in QQ International
Honest Critique
Help me to register in QQ International
Honest Critique
Re: Drag Mobile Phone to take Photo
Can you clarify what you mean? What you described is very vague - when you say drag your phone screen, are you saying a phone screen inside your game? When you say take a photo do you mean it switches to camera mode or it takes a photo immediately? When you say zoom, do you mean zooming in camera mode?
Try to explain in details - or better yet use images to explain exactly what you're trying to achieve and we may better understand you and be more able to help
Otherwise we may come up with an interpretation of what we think you want, that's nothing like what you had in mind.
In fact I half wonder if you're actually saying make your actual phone with a Renpy game running on it to take a photo - the mention of mouse makes me think not but I know you can get a mouse working on Android phones...
Try to explain in details - or better yet use images to explain exactly what you're trying to achieve and we may better understand you and be more able to help
In fact I half wonder if you're actually saying make your actual phone with a Renpy game running on it to take a photo - the mention of mouse makes me think not but I know you can get a mouse working on Android phones...
- 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: Drag Mobile Phone to take Photo
I've not seen any code examples that do what you want.
Perhaps follow Andredron's advice and check out viewport, along with drag n drop, atl or image manipulation and key binding
Perhaps follow Andredron's advice and check out viewport, along with drag n drop, atl or image manipulation and key binding
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
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3636
- Joined: Mon Dec 14, 2015 5:05 am
- Location: Your monitor
- Contact:
Re: Drag Mobile Phone to take Photo
IIRC, Pytom once replied to a similar request about using a camera to take a shot to be used as your side image.
I don't recall the exact words, but I believe the answer was something along the lines of 'no, bad idea'
I don't recall the exact words, but I believe the answer was something along the lines of 'no, bad idea'
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
- xavimat
- Eileen-Class Veteran
- Posts: 1458
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love, unknown
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Contact:
Re: Drag Mobile Phone to take Photo
Mirenzo has a screen with the image of a cellphone. He wants to drag it on the screen and take a "photo" of the part of the background image that the cellphone is showing. I think this can be done with drag, screenshot and crop. But I'm not sure about the zooming part. Can we put the mousewheel as key in the screen and trigger an action to zoom?
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3636
- Joined: Mon Dec 14, 2015 5:05 am
- Location: Your monitor
- Contact:
Re: Drag Mobile Phone to take Photo
Why snap a screenshot, crop and zoom it?
Just fake it. Use a pre-prepared image and pretend the photo was taken.
Or is this something the user chooses, so the possible photos are limitless(ish)?
Just fake it. Use a pre-prepared image and pretend the photo was taken.
Or is this something the user chooses, so the possible photos are limitless(ish)?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
- xavimat
- Eileen-Class Veteran
- Posts: 1458
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love, unknown
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Contact:
Re: Drag Mobile Phone to take Photo
Yes, this is my conclusion after trying to do it real.
I haven't tried the zoom feature.
Code here. Downloadable at the end:
(All positions/sizes of draggables should be adjusted)
Code: Select all
default photo_list = []
default person = ""
default x = 500
default y = 200
init python:
def cell_dragged(drags, drop):
store.x = drags[0].x
store.y = drags[0].y
if not drop:
return
return drop.drag_name
screen take_photo():
add "people_fit"
draggroup:
# The cellphone.
drag:
child "cell"
droppable False
dragged cell_dragged
xpos x ypos y
# The targets.
drag:
drag_name "one"
idle_child Solid("#0000", xysize=(50,50))
# Just trying to see when the drag is droppable:
selected_idle_child Solid("#0004", xysize=(50,50))
draggable False
pos (121, 43)
drag:
drag_name "two"
child Solid("#0000", xysize=(50,50))
draggable False
pos (100, 257)
drag:
drag_name "three"
child Solid("#0000", xysize=(50,50))
draggable False
pos (592, 217)
drag:
drag_name "four"
child Solid("#0000", xysize=(50,50))
draggable False
pos (708, 56)
drag:
drag_name "five"
child Solid("#0000", xysize=(50,50))
draggable False
pos (1070, 9)
hbox:
yalign 1.0 spacing 10
for i in photo_list:
frame:
add i
frame:
align (1.0,1.0)
has hbox
textbutton "Take a Photo" action Return("photo")
textbutton "Exit" action Return("exit")
image white = Solid("#fff")
label start:
scene black with None
jump taking_photos
label taking_photos:
call screen take_photo
$ result = _return
if result in ["one", "two", "three", "four", "five"]:
$ person = result
jump taking_photos
elif result == "photo":
if person and person not in photo_list:
$ photo_list.append(person)
play sound "picture.ogg"
scene white with dissolve
jump taking_photos
scene black with None
$ person = ""
"We can go on from here..."
return
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Re: Drag Mobile Phone to take Photo
I'll try to explain myself better with some images:
https://attachments.f95zone.com/2018/06 ... empio3.jpg[/img]
. That's what any cellphone do. About a pre-prepared image, how can i know where and when my players decide to take a photo? The only thing i can do is disable the camera from my Phone and make that available only when i want.
https://attachments.f95zone.com/2018/06 ... empio3.jpg[/img]
. That's what any cellphone do. About a pre-prepared image, how can i know where and when my players decide to take a photo? The only thing i can do is disable the camera from my Phone and make that available only when i want.Re: Drag Mobile Phone to take Photo
Just a thought, if player would be able to take photo of any part of a game screen, how would you evaluate is this the 'right' photo or not?
As for design of this game - draw some transparent space in the middle of the cellphone and try xavimat's code.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot], span4ev