Changing Text Styles

A place to discuss things that aren't specific to any one creator or game.
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
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, SetVariable('cPoint', cPoint+word.cPoint), SetVariable('jnPoint', jnPoint+word.jnPoint), SetVariable('jaPoint', jaPoint+word.jaPoint)], xpos=x, ypos=i * 52 + ystart)

            t = ui.interact()
            r = random.randint(0, 10)
            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
also less important but if there is a way i could also have the text in the style b centered instead of all aligned on the left i would appreciate that also

jeffster
Veteran
Posts: 361
Joined: Wed Feb 03, 2021 9:55 pm
Contact:

Re: Changing Text Styles

#2 Post by jeffster »

You can use the style inspector (Shift-i hovering over screen elements) to inspect the structures of your screen and the styles that affect them.

User avatar
Elliot Dreemurr
Newbie
Posts: 17
Joined: Fri Aug 13, 2021 5:38 pm
Projects: Only You
Discord: 💙 Elliot/Ellie Dreemurr 💙#2000
Contact:

Re: Changing Text Styles

#3 Post by Elliot Dreemurr »

ohhh i didnt know about this but its very interesting and helpful thank u

Post Reply

Who is online

Users browsing this forum: No registered users