[SOLVED]Finding X and Y Coordinates
Posted: Wed Sep 30, 2020 1:31 pm
Another beginner question: what the easiest way to find X and Y coordinates in a an existing scene?
Supporting creators of visual novels and story-based games since 2003.
https://lemmasoft.renai.us/forums/
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()
In your first post in the thread you click on the pencil-icon ("Edit post"). It is in the top-right corner.