Page 1 of 1

Changing Text Styles

Posted: Sat Aug 28, 2021 3:59 am
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

Re: Changing Text Styles

Posted: Sun Sep 19, 2021 12:34 pm
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.

Re: Changing Text Styles

Posted: Mon Sep 20, 2021 3:07 pm
by Elliot Dreemurr
ohhh i didnt know about this but its very interesting and helpful thank u