Custom caret in Name Input screen not animating

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
User avatar
AERenoir
Veteran
Posts: 320
Joined: Fri May 27, 2011 8:23 pm
Contact:

Custom caret in Name Input screen not animating

#1 Post by AERenoir »

Hi, in my name input screen, I have create a custom caret (the blinking line indicating the text) in the shape of a pen bouncing up and down.
This was built in Renpy 6.16.2. Ever since upgrading to Renpy 6.99.10 and upwards, this code doesn't work. The pen is there, but it's static and not moving. I do check the changes between builds, but I'm still kind of confused.

Code: Select all

image mycaret: 
    "brush.png"
    yoffset -5
    pause .4
    yoffset 5
    pause.4                                                    
    repeat
image brush:
    "mycaret"
    xalign 0 yalign .9
init python:
   def SetThumbnailFull():
        config.thumbnail_width = config.screen_width
        config.thumbnail_height = config.screen_height
   #def entername(newstring):
   #     store.firstname = newstring
   def entername(input_text):
        global firstname
        firstname = input_text
init:
    $ style.input.caret = "brush"
    default firstname = "Eileen"
Last edited by AERenoir on Tue Sep 11, 2018 7:17 am, edited 1 time in total.

User avatar
MaydohMaydoh
Regular
Posts: 165
Joined: Mon Jul 09, 2018 5:49 am
Projects: Fuwa Fuwa Panic
Tumblr: maydohmaydoh
Location: The Satellite of Love
Contact:

Re: Problem with custom caret in Name Input screen

#2 Post by MaydohMaydoh »

Instead of having two separate images, try merging them,

Code: Select all

image mycaret: 
    "brush.png"
    align (0.0, 0.9)
    block:
        yoffset -5
        pause .4
        yoffset 5
        pause.4                                                    
        repeat

User avatar
AERenoir
Veteran
Posts: 320
Joined: Fri May 27, 2011 8:23 pm
Contact:

Re: Problem with custom caret in Name Input screen

#3 Post by AERenoir »

Tried it. It's still not moving.

I checked if maybe the animation loop code is what's broken, but when placed elsewhere (e.g. in the game scene), it does bounce as it should.

User avatar
AERenoir
Veteran
Posts: 320
Joined: Fri May 27, 2011 8:23 pm
Contact:

Re: Custom caret in Name Input screen not animating

#4 Post by AERenoir »

Tried doing it another way, still not working

Code: Select all

image brush_caret:
    "brush.png"
    align (0.0, 0.9)
    block:
        yoffset -5
        pause .4
        yoffset 5
        pause.4                                                    
        repeat
        

style input:
        caret "brush_caret"        
init python:
   def SetThumbnailFull():
        config.thumbnail_width = config.screen_width
        config.thumbnail_height = config.screen_height
  
   def entername(input_text):
        global firstname
        firstname = input_text
init:

    
        
    default firstname = "Eileen"
    
    
screen inputname:
    add "name2.jpg"
    input default firstname changed entername  xpos 574 ypos 433 size 120 length 9 color "#000" font "YOZAKURA-Regular.otf"

philat
Eileen-Class Veteran
Posts: 1909
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Custom caret in Name Input screen not animating

#5 Post by philat »

Looks like, for whatever reason, the caret can't change its position after it's first rendered. Probably not changeable without PyTom's input.

User avatar
AERenoir
Veteran
Posts: 320
Joined: Fri May 27, 2011 8:23 pm
Contact:

Re: Custom caret in Name Input screen not animating

#6 Post by AERenoir »

Darn. I went and asked in the Renpy release thread, so hopefully Pytom can help.

Post Reply

Who is online

Users browsing this forum: BeverlyLane, Google [Bot]