Mouse pointer changing

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
VIGOR GAMES
Newbie
Posts: 1
Joined: Thu Apr 29, 2021 3:06 am
Contact:

Mouse pointer changing

#1 Post by VIGOR GAMES » Thu Apr 29, 2021 3:11 am

Hello everyone,

I have a problem with changing cursor in mid game....

I need change mouse pointer to zoomer for a while and then change it back to standart cursor.

I'm using this code, but it doesnt work properly.

Code: Select all

init python:
    def change_cursor(type="default"):
        persistent.mouse = type
        if type == "default":
            setattr(config, "mouse", None)
        elif type == "1":
            setattr(config, "mouse", {"default": [("images/1.png", 0, 0)]})
        elif type == "2":
            setattr(config, "mouse", {"default": [("images/2.png", 0, 0)]})

    if not hasattr(persistent, "mouse"):
        change_cursor()
    else:
        change_cursor(persistent.mouse)

Code: Select all

    $ change_cursor("1") #Here cursor must change to zoomer
    
    elina "Some text"
    
    scene w058_1

    elina "Some text"
    
    $ change_cursor() #Here cursor must change to standart

Post Reply

Who is online

Users browsing this forum: Phagocytosis