[SOLVED]Finding X and Y Coordinates

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
galadain
Regular
Posts: 31
Joined: Wed Sep 09, 2020 4:24 pm
Contact:

[SOLVED]Finding X and Y Coordinates

#1 Post by galadain »

Another beginner question: what the easiest way to find X and Y coordinates in a an existing scene?
Last edited by galadain on Thu Oct 01, 2020 10:16 am, edited 1 time in total.

Harimak
Newbie
Posts: 9
Joined: Tue Sep 08, 2020 12:14 am
Deviantart: KimisuCandy

Re: Finding X and Y Coordinates

#2 Post by Harimak »

I do it like that:
You start your game> shift + d> image location picker> search your image
sample: https://youtu.be/L9Vt7fcwkXk?t=513

drKlauz
Veteran
Posts: 239
Joined: Mon Oct 12, 2015 3:04 pm
Contact:

Re: Finding X and Y Coordinates

#3 Post by drKlauz »

I use this

Code: Select all

default show_mouse_pos_info=False

init python:
  class DevtoolMouseposDisplayable(renpy.Displayable):
    def render(self,width,height,st,at):
      tr=Text("{}x{}".format(*renpy.get_mouse_pos()),color="#F00",font="DejaVuSans.ttf").render(width,height,st,at)
      bgr=Solid("#0004").render(max(160,tr.width+32),max(64,tr.height+32),st,at)
      rv=renpy.Render(bgr.width,bgr.height)
      rv.blit(bgr,(0,0))
      rv.blit(tr,((bgr.width-tr.width)//2,(bgr.height-tr.height)//2))
      renpy.redraw(self,0)
      return rv

screen devtool_mousepos():
  zorder 9999
  key '`' action ToggleVariable("show_mouse_pos_info")
  if show_mouse_pos_info:
    add DevtoolMouseposDisplayable()
You need to show devtool_mousepos screen at start of game. Then press `(button below esc) to show/hide current mouse pos.
I may be available for hire, check my thread: viewtopic.php?f=66&t=51350

galadain
Regular
Posts: 31
Joined: Wed Sep 09, 2020 4:24 pm
Contact:

Re: Finding X and Y Coordinates

#4 Post by galadain »

Thanks everyone. This worked.

How do I mark this as "solved"?

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: Finding X and Y Coordinates

#5 Post by Per K Grok »

galadain wrote: Wed Sep 30, 2020 10:20 pm ---

How do I mark this as "solved"?
In your first post in the thread you click on the pencil-icon ("Edit post"). It is in the top-right corner.
In the window that opens you have a field for "Subject". That is the title of the thread. Add "[SOLVED]" to the text in that field and press the submit button below the area for the main text of the post.

Post Reply

Who is online

Users browsing this forum: SypherZent