Changing Text Styles

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
Elliot Dreemurr
Newbie
Posts: 17
Joined: Fri Aug 13, 2021 5:38 pm
Projects: Only You
Discord: 💙 Elliot/Ellie Dreemurr 💙#2000
Contact:

Changing Text Styles

#1 Post by Elliot Dreemurr »

im unsure where 2 specify a new style of text 4 this minigame and when i try it either breaks everything or completely ignores it...i have the style defined but idk where 2 place it saying that i want the text 2 display as such here

Code: Select all

label minigame:
    if chapter == 2 and winner == 'c':
        jump bakinggame
    else:
        jump socialgame

style minigametext:
    font "vgafix.ttf"

init python:
    import random

    class SocialWord:
        def __init__(self, word, cPoint, jnPoint, jaPoint):
            self.word = word
            self.cPoint = cPoint
            self.jnPoint = jnPoint
            self.jaPoint = jaPoint

    social_words = []
    with renpy.file('SocialWords.txt') as wordfile:
        for line in wordfile:

            line = line.strip()

            if line == '' or line[0] == '#': continue

            x = line.split(',')
            social_words.append(SocialWord(x[0], int(x[1]), int(x[2]), int(x[3])))

label socialgame(transition=True):
    stop music fadeout 2.0
    scene grey with fadeoutslow
    show screen quick_menu
    #play music
    $ config.skipping = False
    $ config.allow_skipping = False
    if chapter == 1:
        call screen intro("What is everyone up to these days?\n\nPick out posts that you're friends\n have shared and pertain to whomever you like most!", ok_action=Return())
    python:
        progress = 1
        numWords = 25
        words = list(social_words)
        cPoint=0
        jnPoint=0
        jaPoint=0

        ystart = 270
        while True:
            pstring = str(progress)
            ui.text(pstring + "/" + str(numWords), xpos=790, ypos=200, color='#000')
            for j in range(2):
                if j == 0:
                    x = 510
                else:
                    x = 650
                for i in range(4):
                    word = random.choice(words)
                    words.remove
                    ui.textbutton(word.word, clicked=ui.returns(word), xpos=x, ypos=i * 52 + ystart)

            t = ui.interact()
            if t.cPoint >= 2:
                renpy.show("chara leap")
            if t.jaPoint >= 2:
                renpy.show("jessica leap")
            if t.jnPoint >= 2:
                renpy.show("jamison leap")
            cPointTotal += t.cPoint
            jaPointTotal += t.jaPoint
            jnPointTotal += t.jnPoint
            progress += 1
            if progress > numWords:
                renpy.jump('points')

    label points:

        if jnPoint > jaPoint and jnPoint > cPoint:
            $ winner = 'jn'
        elif jaPoint > cPoint:
            $ winner = 'ja'
        else:
            $ winner = 'c'

        $ config.allow_skipping = True
        $ allow_skipping = True
        stop music fadeout 2.0
        hide screen quick_menu
        scene black with dissolveslow
        pause 1.0
        return

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], downover