init Python:
class AONMousePos(renpy.Displayable):
x = 0
y = 0
def __init__(self, **kwargs):
super(AONMousePos, self).__init__(**kwargs)
def event(self, ev, x, y, st):
if (x < 0 or y < 0): return None
import pygame_sdl2 as pygame
if ev.type != pygame.MOUSEMOTION: return None
self.x = x
self.y = y
renpy.redraw(self, 0)
def render(self, width, height, st, at):
rv = renpy.Render(width, height)
rv.blit( renpy.render(Text( "X: {}\nY: {}".format( int( self.x ), int( self.y ) ), size=20, color="#fff", outlines=[ (1, "#000", 0, 0 ) ]), width, height, st, at), (0, 0))
return rv
config.overlay_screens.append( "AONMousePos" )
screen AONMousePos():
zorder 1000
vbox:
xalign 0.0 yalign 0.0
add AONMousePos()