Transforming Objects Post Creation

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
The Baconator
Newbie
Posts: 1
Joined: Tue Apr 16, 2019 1:06 pm
Soundcloud: the-baconator-117
Contact:

Transforming Objects Post Creation

#1 Post by The Baconator »

Heyo, I've been working on a VN that primarily takes place in chatrooms, and for the life of me I cant figure out how to move an object post creation. My current idea for how it would work is to have the user (a picture of a blank message, containing the name and PFP of the user) appear, and to move all previous messages up by a set distance to make space for the new one. I've managed to get the messages to send using screens, but can't manage to move previous ones. An idea I've had is to perhaps somehow tag all images I wish to move up and call a transform upon clicking, but I'm not entirely sure how to do that.

Currently, my issues are that:
I'm unsure how to transform images after creation (eg. after click)
I'm unsure how to create images at a set point and provide transformations after (using at makes them create at the transformation)

Screens:

Code: Select all

image char_m = "images/char_m.png"

screen msgtxt(what):
    frame:
        hbox:
            spacing 10
            xalign 0 ypos 578 xpos 387
            text what id "what" size 16
            $ move += 40

default move = 0

screen ch():
    frame:
        add "images/char_m.png" at bmove
        xalign 0.5 ypos 538

transform bmove():
    linear 1.0 ypos move
Options:

Code: Select all

label ch_msg(what):
    show screen ch()
    show screen msgtxt(what)
    $ renpy.pause ()
    $ move = True
return
Script:

Code: Select all

    scene bg chat
    with dissolve

    window hide
    play music "chat.wav"
    call ch_msg("gamer testing time.")
Any help is appreciated.

Post Reply

Who is online

Users browsing this forum: No registered users