[SOLVED] Display image without breaking up a sentence

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
Chiligoat
Regular
Posts: 31
Joined: Thu Mar 21, 2019 7:42 pm
Projects: Witches 4 Hire
Location: Sweden
Contact:

[SOLVED] Display image without breaking up a sentence

#1 Post by Chiligoat »

Hey folks! Been a long time since I messed around with Ren'py. I was wondering if there's a way to display an image whilst in the middle on a dialogue box without having to break it up? Perhaps adding code within the quotation marks that forms the what of a dialogue box? Sort of like this:

Code: Select all

speaker "Sentence 1 /CALL TO SHOW IMAGE HERE AND WHEN IT'S LOADED, MOVE ON TO/ Sentence 2"
I figure maybe yes since you can add things like a wait call with {w}? But I also want to clarify that I'm not looking to add an image in the actual text, just a call to display/change an image outside of the textbox like how you normally would. Another way to do it that I can think of would be if you could close the current line, add the image, and then add new text to the dialogue box that is currently displaying? Sort of like this:

Code: Select all

speaker "Sentence 1" RETAIN THIS WINDOW
show image with dissolve
speaker "Sentence 2" ADDED TO THE ABOVE WINDOW
Suggestions? Obvious commands I'm overlooking?
Last edited by Chiligoat on Sat Apr 17, 2021 11:41 am, edited 1 time in total.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2384
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Display image without breaking up a sentence

#2 Post by Ocelot »

It looks like the job for fast tag" https://www.renpy.org/doc/html/text.html#text-tag-fast

Or you can use extend character:

Code: Select all

speaker "sentence 1{nw}"
show image with dissolve
extend "sentence 2"
< < insert Rick Cook quote here > >

User avatar
Chiligoat
Regular
Posts: 31
Joined: Thu Mar 21, 2019 7:42 pm
Projects: Witches 4 Hire
Location: Sweden
Contact:

Re: Display image without breaking up a sentence

#3 Post by Chiligoat »

Oh extend is great and very close to what I wanted exactly. However, I tried both of your suggestions and in both cases the dialogue box flickers out of existence when it reaches that {nw} tag, and returns the moment the image begins to fade in, even though no "window hide" command has been called.

Edit: this is because of the dissolve; it wipes the full screen and takes the text-box with it, fading it back in before the second sentence commences

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Display image without breaking up a sentence

#4 Post by Imperf3kt »

Create an ATL image with a delay and show it before your sentence?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Chiligoat
Regular
Posts: 31
Joined: Thu Mar 21, 2019 7:42 pm
Projects: Witches 4 Hire
Location: Sweden
Contact:

Re: Display image without breaking up a sentence

#5 Post by Chiligoat »

I'd like the image to show up at that point in the text regardless of the player's chosen text speed, so unless the text can create a signal that the ATL image timer can catch and run at, I think it's probably easier to somehow force the text box ignore the dissolve transition?

User avatar
Chiligoat
Regular
Posts: 31
Joined: Thu Mar 21, 2019 7:42 pm
Projects: Witches 4 Hire
Location: Sweden
Contact:

Re: Display image without breaking up a sentence

#6 Post by Chiligoat »

Further experimentation with this rather frustrating issue:
* The dialogue window is actually firmly in place; I just didn't see it because my background was black. Now that it's grey I can see I was wrong.
* Displayables like images or text outside of the dialogue window that were previously shown are in place and unaffected by the vanish+fadein.
The only thing that vanishes when calling show image is the text in the dialogue box, ie. Sentence 1! I just can't fathom how to keep it in place while the image fades in!

strayerror
Regular
Posts: 159
Joined: Fri Jan 04, 2019 3:44 pm
Contact:

Re: Display image without breaking up a sentence

#7 Post by strayerror »

It's possible that using a layer specific dissolve will do what you're hoping. It will dissolve only the master layer leaving the screens layer (on which the say screen typically resides) unaffected.

Code: Select all

speaker "sentence 1{nw}"
show image with {'master': dissolve}
extend "sentence 2"

User avatar
Chiligoat
Regular
Posts: 31
Joined: Thu Mar 21, 2019 7:42 pm
Projects: Witches 4 Hire
Location: Sweden
Contact:

Re: Display image without breaking up a sentence

#8 Post by Chiligoat »

Yes, this worked perfectly! Thank you so much; I didn't know you could define layers like this :>

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: [SOLVED] Display image without breaking up a sentence

#9 Post by Imperf3kt »

Something that didn't occur to me before, are you using window auto or window show?
I believe the default setting (in options.rpy) is set to auto.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: Bing [Bot]