[solved] make one word in the text 'shiver' ?

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
renoa-heartilly
Regular
Posts: 115
Joined: Sat Jul 17, 2010 2:37 am
Completed: مقهى الضائعون, Arabic Translations for Ren'py, Pretty Please
Projects: حور, BB project, dentist drama
Organization: stanza studio (creative circle)
Contact:

[solved] make one word in the text 'shiver' ?

#1 Post by renoa-heartilly »

I'm always testing out new things in Ren'Py and now with NaNoWriMo coming up, i'm wondering if i can make my current story a visual novel since it is more daily life and dialogue-based than a series of events like most printed novels.
the thing is, the main character has an ability, and she feels it when the person speaks but she doesn't make any dramatic actions over it, she just feels tingly.
for example, this dialogue.
Girl: Hello, how may i help you?
Boy: Hello, i need to make ((an appointment)), can you help me?
(something like this)
Image

the word in the brackets needs to be highlighted but not in a specific color or font weight, it would work better if it is very subtle such as the letters jump up and down a pixel or two as if the word was shaking.
is such an effect possible? i apologize if it has been explained before, most of the time when i search things it is either not what i want or in the outdated wiki pages ._.
thank you for your time!
Last edited by renoa-heartilly on Wed Nov 06, 2013 9:09 pm, edited 1 time in total.

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

Re: Is it possible to make one word in the text 'shiver' ?

#2 Post by xavimat »

This effect, letter by letter is really complex (It can be done, also).
I've done a simpler one, to show how to add effects to words. You can change the ATL in the image definition to your needs.

Code: Select all

image word_effect:
    Text("[the_word]")
    alpha 1.0
    pause .4
    alpha 0.0
    pause .1
    repeat
    
# The game starts here.
label start:
    $ the_word = "an appointment"
    "Hello, i need to make {image=word_effect}, can you help me?"
    $ the_word = "Really?"
    "{image=word_effect}"
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
renoa-heartilly
Regular
Posts: 115
Joined: Sat Jul 17, 2010 2:37 am
Completed: مقهى الضائعون, Arabic Translations for Ren'py, Pretty Please
Projects: حور, BB project, dentist drama
Organization: stanza studio (creative circle)
Contact:

Re: Is it possible to make one word in the text 'shiver' ?

#3 Post by renoa-heartilly »

hello xavimat, thanks for the input!
i tried it and it makes the word flash, it is not what i need but since you say it is difficult, is it possible to make the flashing less obvious? for example ease it in and out instead of the choppy 1second interval? or maybe make it fade colors gradually?

i'm assuming the shiver effect can be done if it's possible to tell the script to shift each odd letters up 1 pixel and each even letters 1 pixel down, in any given one word, but i'm not that knowledgeable in Ren'Py or Python to even assume it's a thing that can happen XD

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

Re: Is it possible to make one word in the text 'shiver' ?

#4 Post by xavimat »

renoa-heartilly wrote:hello xavimat, thanks for the input!
i tried it and it makes the word flash, it is not what i need but since you say it is difficult, is it possible to make the flashing less obvious? for example ease it in and out instead of the choppy 1second interval? or maybe make it fade colors gradually?
You can play with different ATL possibilities. See http://www.renpy.org/doc/html/atl.html
renoa-heartilly wrote:i'm assuming the shiver effect can be done if it's possible to tell the script to shift each odd letters up 1 pixel and each even letters 1 pixel down, in any given one word, but i'm not that knowledgeable in Ren'Py or Python to even assume it's a thing that can happen XD
Ok. I can't (yet) move letters a pixel up, but I've made a function to apply text tags to odd letters/even letters.
Try it, maybe it's useful to you.

Code: Select all

init python:
    
    txt1 = ""
    txt2 = ""
    txt3 = ""
    
    def word_effect(txt):
        global txt1, txt2, txt3
        txt1 = txt
        txt2 = ""
        txt3 = ""
        i = 2
        for letter in txt:
            i += 1
            if i % 2 == 0:
                txt2 += letter
                # Instead of "size" any text tag can be applied here,
                # see: http://www.renpy.org/doc/html/text.html#styling-and-text-tags
                txt3 += "{size=-2}" + letter + "{/size}"
            else:
                txt2 += "{size=-2}" + letter + "{/size}"
                txt3 += letter

image we1:
    # A simple word effect
    Text("[txt2]")
    pause .2
    Text("[txt3]")
    pause .2
    repeat
    
image we2:
    # A word effect with a random waiting pause
    # You can play with different ATL transforms
    Text("[txt1]")
    block:
        choice:
            pause 1.0
        choice:
            pause .8
        choice:
            pause .6
        choice:
            pause .4
    block:
        choice:
            Text("[txt2]")
            pause .2
        choice:
            Text("[txt3]")
            pause .2
    repeat
    
# The game starts here.
label start:
    $ word_effect("an appointment")
    "Two possibilities" "Hello, i need to make {image=we1}, can you help me?\nHello, i need to make {image=we2}, can you help me?"
    $ word_effect("sure")
    "Two possibilities" "Are you {image=we1}?! (Nicer effect with shorter words.)\nAre you {image=we2}?!"

    return
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
renoa-heartilly
Regular
Posts: 115
Joined: Sat Jul 17, 2010 2:37 am
Completed: مقهى الضائعون, Arabic Translations for Ren'py, Pretty Please
Projects: حور, BB project, dentist drama
Organization: stanza studio (creative circle)
Contact:

Re: Is it possible to make one word in the text 'shiver' ?

#5 Post by renoa-heartilly »

wow that first word effect works exactly how i needed it!
I'm assuming you did it by changing the size of the letters as oppose to shifting them up or down, huh?
it's the effect i hoped for, don't matter how it's achieved :lol:
thank you very much! :mrgreen:

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot]