What pixel am I hitting?

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
Mochiron
Regular
Posts: 30
Joined: Fri May 09, 2008 9:46 am
Contact:

What pixel am I hitting?

#1 Post by Mochiron »

So, I'm trying to figure out a way to figure out where the player is clicking on the screen. I'm aware of renpy.imagemap, but I would like to avoid defining 800 x 600 hotspots or so. Since renpy.imagemap works at all I can only assume that the program knows where the user is clicking. Is there a way to hijack those results and just save it into variables?

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: What pixel am I hitting?

#2 Post by PyTom »

You need to create a user-defined displayable to do this. Ren'Py is set up so that all games can be played with a keyboard or joystick, so it's not always the case that there even _is_ a particular point where the used clicked to activate a button.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Mochiron
Regular
Posts: 30
Joined: Fri May 09, 2008 9:46 am
Contact:

Re: What pixel am I hitting?

#3 Post by Mochiron »

I'm confused. Could you elaborate a little on how I should/could go about it?

Edit: Just tell me to hit the books, If it's overly complicated. ;)

Guest

Re: What pixel am I hitting?

#4 Post by Guest »

Mochiron wrote:I'm confused. Could you elaborate a little on how I should/could go about it?

Edit: Just tell me to hit the books, If it's overly complicated. ;)
Except not much has been written anywhere about making your own displayables.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: What pixel am I hitting?

#5 Post by PyTom »

Sorry: What's documented can be found at:

http://www.renpy.org/wiki/renpy/doc/ref ... splayables
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Bing [Bot]