Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hey there! The cursor should already stay put by default - do you have an example of code where you're seeing this behaviour?

Sorry for the slow reply! The code you've created is completely untouched - I reverted all the changes after messing around (even replaced the 01_virtual_cursor.rpy file with an untouched version just to make extra sure). The place I'm seeing this behavior in-game is during an investigation segment which uses image buttons inside a screen. This code is in screens.rpy and it looks like this:

I'll then call the screen in-game and use a series of labels to jump to each event like this...which I'm just now realizing is exactly my problem!!! When the event jumps back to the broom_nav label, the screen is called again, resetting the position of the cursor. 

Clearly there's a better way to code this that I didn't come up with the first time around (I'm self taught okay...) so I'll look into that! If you have any pointers you'd like to share, I'd really appreciate it. Otherwise, no pressure! You've helped me enough by making the perfect expansion :-)

No worries! I will look into adding a built-in feature so that the screen language version can save its position between being shown - there is already a property to indicate the starting position, so the only addition would be to save the current position somewhere so that it can be re-applied when the screen is shown again. In the meantime however, you can declare the cursor in Python with default, which will save it! e.g.

default vc = VirtualCursor(cursor=(Transform("gui/window_icon.png", xysize=(50, 50)), 0, 0))
screen investigation():
    vbox:
        spacing 100 align (0.5, 0.9)
        textbutton _("Hello") action Notify("world")
        textbutton _("Jump") action Jump("bedroom")
    add vc

The `add vc` bit adds the cursor to the screen, just like the `virtual_cursor` line. You can add whichever properties you like in the vc declaration e.g. `VirtualCursor(cursor=<...>, snap_to_center=True, which_stick="left")`

Hope that helps!

Wow, this works perfectly! Thank you for taking the time to look into this - I really do appreciate it!