Simple Scrolling/Fading Text Popups in a Screen

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.
Message
Author
User avatar
Rosstin2
Veteran
Posts: 253
Joined: Thu Jan 09, 2014 12:42 pm
Completed: King's Ascent, Kitty Love
Projects: Queen At Arms, Rex Rocket
Organization: Aqualuft Games
Contact:

Re: Simple Scrolling/Fading Text Popups in a Screen

#16 Post by Rosstin2 »

Asceai wrote:
Rosstin wrote:Can you use ATL inside a screen?
You can give 'at' in a screen and give a transform, e.g:

Code: Select all

text "blah" at MyTransform
and put the ATL in the transform

Code: Select all

transform MyTransform:
  alpha 0.0 rotate -180
  linear 1.0 alpha 1.0 rotate 0
Oh maaaaaaan that's exactly what I needed.
Image

User avatar
Rosstin2
Veteran
Posts: 253
Joined: Thu Jan 09, 2014 12:42 pm
Completed: King's Ascent, Kitty Love
Projects: Queen At Arms, Rex Rocket
Organization: Aqualuft Games
Contact:

Re: Simple Scrolling/Fading Text Popups in a Screen

#17 Post by Rosstin2 »

UGH I spent soooooo many hours trying to solve it and the solution was so simple. :evil:

You can't see it because I have trouble screenshotting at the exact right time, but it's scrolling and disappearing.

Image

BEFORE:

Code: Select all

 screen showPoints(numPoints, boyObject):
    $pointsPopup="+"+str(numPoints)+" "+boyObject.name+" Relationship"
    text pointsPopup
AFTER:

Code: Select all

screen showPoints(numPoints, boyObject):
    $pointsPopup="+"+str(numPoints)+" "+boyObject.name+" Relationship"
    text pointsPopup at MyTransform
Kill me now XD

Now I just have to ATL it the way I want which will be trivial.
Image

User avatar
Rosstin2
Veteran
Posts: 253
Joined: Thu Jan 09, 2014 12:42 pm
Completed: King's Ascent, Kitty Love
Projects: Queen At Arms, Rex Rocket
Organization: Aqualuft Games
Contact:

Re: Simple Scrolling/Fading Text Popups in a Screen

#18 Post by Rosstin2 »

EDIT: This is unrelated but it's driving me CRAZY. Does Editra have a way to do multiline #s for multiline comments? Using '''for multiline comments is terrible because it's quite often that I use apostrophes.'''

EDIT2: The only thing I don't like about this solution is that it requires me to Renpy.Pause() so that the point value increase can be displayed. This is a little annoying... but I have bigger fish to fry so I'm gonna let it be for now.

OK, my points code for now:

Code: Select all

init:
    transform popupText:
        alpha 1.0 xalign 0.08 yalign 0.15
        linear 0.5 alpha 1.0 xalign 0.08 yalign 0.07
        linear 0.5 alpha 0.0 xalign 0.08 yalign 0.00
    
screen showPoints(numPoints, boyObject):
    $pointsPopup="+"+str(numPoints)+" "+boyObject.name+" Relationship"
    text pointsPopup at popupText

init python: 
    class Boy:
        # a love interest        
        def __init__(self, name, respect, affection):
            self.name = name
            self.respect = respect
            self.affection = affection

    nObject = Boy('Sir Nicholas', 5, 20)


init python:
    def increaseRelationshipPoints(myPoints, myValue, boyObject):
        global genericRespect
        global genericAddPoints
        genericRespect = myPoints
        genericAddPoints = myValue
        
        renpy.show_screen("showPoints", myValue, boyObject)
        renpy.pause()
        renpy.hide_screen("showPoints")
        
        return (myPoints+myValue)

# RESPECT AND AFFECTION BARS BY OokamiKasumi http://lemmasoft.renai.us/forums/viewtopic.php?f=51&t=22147
init -2 python:
    # Relationships (tentatively, these go from 0 to 100, 100 being the max. 
    # They can go higher, but above 100 doesn't really matter and the meter doesn't display it as going up.
    
    genericRespect = 0
    genericAddPoints = 5
    
    maximumPoints = 100
    
    jamesRespect         = 10        # the kid
    jamesAffection       = 15        # 
    
    nicholasRespect      =  5        # the brother
    nicholasAffection    = 20        # 
    
    rubusRespect         =  5        # the archmage
    rubusAffection       = 10 
    
    luciusRespect        = 10        # the cleric
    luciusAffection      =  5
    
    alastorRespect       = 10        # the prince.
    alastorAffection     = 10        # you get a nice boost in both stats when you rescue him from the wolves
    
    foxRespect           =  5        # the ninja. He earns respect and affection very slowly
    foxAffection         =  5        # but later his total is added to alastors # perhaps just his affection is added to Al and his respect goes to panther
    
    soldierRespect       =  0        # the generic respect your fellow soldiers feel for you
    
    # $ sylgardianRespect  = 5 #respect that sylgardian troops feel for you
    
    # no affection value    
    
    berinRespect         =  5        # the assistant-commander
    berinAffection       =  5        # total fakeout
        
    bryceRespect         = 15        # because you're nick's brother
    # no because ew
    
    kendrickRespect      =  0        # mad king kendrick
    
    #boyWithHighestAffection = "James" #create a function to change this to the boy whose affection is currently the highest
And you use it like this:

Code: Select all

            mc "Love me, Nick. nicholasAffection: %(nicholasAffection)s"
            $nicholasAffection= increaseRelationshipPoints(nicholasAffection,35, nObject)                    
            mc "nicholasAffection: %(nicholasAffection)s"
Image

User avatar
Rosstin2
Veteran
Posts: 253
Joined: Thu Jan 09, 2014 12:42 pm
Completed: King's Ascent, Kitty Love
Projects: Queen At Arms, Rex Rocket
Organization: Aqualuft Games
Contact:

Re: Simple Scrolling/Fading Text Popups in a Screen

#19 Post by Rosstin2 »

Result:

ImageImage
Image

Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Simple Scrolling/Fading Text Popups in a Screen

#20 Post by Asceai »

Rosstin wrote:EDIT: This is unrelated but it's driving me CRAZY. Does Editra have a way to do multiline #s for multiline comments? Using '''for multiline comments is terrible because it's quite often that I use apostrophes.'''
This isn't an answer to your question, because I don't use Editra, but Notepad2 (the editor I do use) does this just fine- select and ctrl+q. Of course, notepad2 doesn't support a syntax highlighting scheme for .rpy files so it doesn't know to #-comment them- so what I did was make it treat .rpy files as Python files, because the syntax is so similar and I don't really care about the differences all that much.

User avatar
15nick
Regular
Posts: 33
Joined: Thu Oct 17, 2013 2:46 am
Contact:

Re: Simple Scrolling/Fading Text Popups in a Screen

#21 Post by 15nick »

Rosstin wrote:EDIT: This is unrelated but it's driving me CRAZY. Does Editra have a way to do multiline #s for multiline comments? Using '''for multiline comments is terrible because it's quite often that I use apostrophes.'''
Write it all up, select your comments, then hit CTRL+1. Same for uncommenting multiple lines.

User avatar
Rosstin2
Veteran
Posts: 253
Joined: Thu Jan 09, 2014 12:42 pm
Completed: King's Ascent, Kitty Love
Projects: Queen At Arms, Rex Rocket
Organization: Aqualuft Games
Contact:

Re: Simple Scrolling/Fading Text Popups in a Screen

#22 Post by Rosstin2 »

15nick wrote:
Rosstin wrote:EDIT: This is unrelated but it's driving me CRAZY. Does Editra have a way to do multiline #s for multiline comments? Using '''for multiline comments is terrible because it's quite often that I use apostrophes.'''
Write it all up, select your comments, then hit CTRL+1. Same for uncommenting multiple lines.
THANK YOOOOOOOOOOOUUUUUUUUUUU
Image

Post Reply

Who is online

Users browsing this forum: No registered users