[SOLVED] Possible to explore around a scene moving mouse to screen edge?
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.
- Kinmoku
- Miko-Class Veteran
- Posts: 560
- Joined: Mon Aug 11, 2014 9:39 am
- Completed: One Night Stand
- Projects: Love IRL, Memories
- Tumblr: gamesbykinmoku
- itch: kinmoku
- Location: Germany
- Contact:
[SOLVED] Possible to explore around a scene moving mouse to screen edge?
Hi all. Is it possible to explore around a scene moving the mouse to the screen edge? I have a couple of long images (one tall, one wide) and I want the player to be able to explore up close - when the mouse goes near the edge of the screen, the "camera" moves with it/ the image pans. I hope I'm making myself clear ^^;
Here's an example. It's a 3D game but shows the cursor behaving how I want:
https://youtu.be/OR7aYCnv4IE?t=4241
Here's an example. It's a 3D game but shows the cursor behaving how I want:
https://youtu.be/OR7aYCnv4IE?t=4241
Last edited by Kinmoku on Fri Feb 28, 2020 7:15 am, edited 1 time in total.
Re: Possible to explore around a scene moving mouse to screen edge?
I know you could do this with a custom Displayable, but that may be more work than necessary.
What you could try is creating screen with a transparent image button at each edge of the screen and then attach an action to the button’s hovered that will adjust the offset of the background, so that when the mouse gets close enough to the edge, the background starts to scroll. The trick would be writing the action so that it scrolls at a proper rate.
What you could try is creating screen with a transparent image button at each edge of the screen and then attach an action to the button’s hovered that will adjust the offset of the background, so that when the mouse gets close enough to the edge, the background starts to scroll. The trick would be writing the action so that it scrolls at a proper rate.
- Kinmoku
- Miko-Class Veteran
- Posts: 560
- Joined: Mon Aug 11, 2014 9:39 am
- Completed: One Night Stand
- Projects: Love IRL, Memories
- Tumblr: gamesbykinmoku
- itch: kinmoku
- Location: Germany
- Contact:
Re: Possible to explore around a scene moving mouse to screen edge?
Ah, nice work aroundrames44 wrote: ↑Wed Feb 26, 2020 12:41 pmI know you could do this with a custom Displayable, but that may be more work than necessary.
What you could try is creating screen with a transparent image button at each edge of the screen and then attach an action to the button’s hovered that will adjust the offset of the background, so that when the mouse gets close enough to the edge, the background starts to scroll. The trick would be writing the action so that it scrolls at a proper rate.
- Kinmoku
- Miko-Class Veteran
- Posts: 560
- Joined: Mon Aug 11, 2014 9:39 am
- Completed: One Night Stand
- Projects: Love IRL, Memories
- Tumblr: gamesbykinmoku
- itch: kinmoku
- Location: Germany
- Contact:
Re: Possible to explore around a scene moving mouse to screen edge?
Having a look around the forums, I found a post that helped me: viewtopic.php?t=34086
Here's my code. It works moving the mouse up or down, or if the mouse wheel is used
Awesome!
I've just set it up for imagebuttons instead of an image. In case anyone is interested:
Here's my code. It works moving the mouse up or down, or if the mouse wheel is used
Code: Select all
screen photograph_scroll:
viewport id "photographs":
align (0.5, 0.5)
mousewheel True
edgescroll (150, 800)
child_size (1920, 3240)
add "images/present/photographs.jpg"Code: Select all
screen photograph_scroll:
viewport id "photographs":
align (0.5, 0.5)
mousewheel True
edgescroll (150, 800)
child_size (1920, 3240)
#add "images/present/photographs.jpg"
use photograph_map
screen photograph_map:
add "images/present/photographs.jpg"
imagebutton idle Solid("#0000", xysize=(295, 342)) clicked Play("sound", "sounds/balloon1.ogg") xpos 820 ypos 34 focus_mask None
imagebutton idle Solid("#0000", xysize=(343, 324)) clicked Play("sound", "sounds/balloon1.ogg") xpos 930 ypos 1372 focus_mask NoneRe: [SOLVED] Possible to explore around a scene moving mouse to screen edge?
Ah. “edgescroll”. Didn’t know about that, but PyTom always seems to have anticipated our needs...
- Katy133
- Miko-Class Veteran
- Posts: 704
- Joined: Sat Nov 16, 2013 1:21 pm
- Completed: Eight Sweets, The Heart of Tales, [redacted] Life, Must Love Jaws, A Tune at the End of the World, Three Guys That Paint, The Journey of Ignorance, Portal 2.5.
- Projects: The Butler Detective
- Tumblr: katy-133
- Deviantart: Katy133
- Soundcloud: Katy133
- itch: katy133
- Location: Canada
- Contact:
Re: [SOLVED] Possible to explore around a scene moving mouse to screen edge?
This thread is solved, but this may be additional help to others trying to do this:
Ren'Py comes with a VN you can open called Tutorial. In it, if you select "Screen Displayables," followed by "Viewports" from the menu/index Eileen gives you, you can find an example of "edgescroll" being used. If you open that part of the script in Editra (or whichever script editor you're using), it will help provide you with a method to do the same thing:
Also, I made a thread asking about how to draw a panoramic (you will need that if you want to turn the "camera" over 180 degrees), which has tips you may find useful. Thread: How to Draw Panoramic Rooms?
Ren'Py comes with a VN you can open called Tutorial. In it, if you select "Screen Displayables," followed by "Viewports" from the menu/index Eileen gives you, you can find an example of "edgescroll" being used. If you open that part of the script in Editra (or whichever script editor you're using), it will help provide you with a method to do the same thing:
Code: Select all
screen edgescroll_viewport_screen():
viewport:
xalign 0.5 ypos 50 xysize (700, 300)
edgescroll (150, 500)
mousewheel True
arrowkeys True
add "bg band"
Who is online
Users browsing this forum: Bing [Bot], span4ev


