Inserting graphics into the text in NVL mode.
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.
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.
Inserting graphics into the text in NVL mode.
If I were to make images containing, for example, custom characters, is there a way to insert them into the normal text in NVL mode?
- PyTom
- Ren'Py Creator
- Posts: 15893
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Inserting graphics into the text in NVL mode.
Sure. That's what the {img=character.png} text tag is for.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
Re: Inserting graphics into the text in NVL mode.
I went a little nuts trying to figure out why that didn't work until I was finally able to find the appropriate page of documentation: http://www.renpy.org/wiki/renpy/doc/reference/Text#tags
It's {image=file}.
That said, is there a way to change the height/width in the tag itself, or should I make separate images?
It's {image=file}.
That said, is there a way to change the height/width in the tag itself, or should I make separate images?
- PyTom
- Ren'Py Creator
- Posts: 15893
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Inserting graphics into the text in NVL mode.
IIRC, the width is the width of the image, and the height is fixed to the height of the current line of text. (So it should automatically do the right thing.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
Re: Inserting graphics into the text in NVL mode.
No, I mean... for example, if I have an image that's the height of the text and one pixel wide -- and I put a white pixel in it, can I adjust the width of the image like I could in an HTML tag to create a dash?
Re: Inserting graphics into the text in NVL mode.
Also, is it possible to do a global replace within all NVL text to replace a character with an image? For example, if I use a hyphen (-) in the text, the engine would replace it with {image=dash.png}...
Re: Inserting graphics into the text in NVL mode.
If you want a dash, you'll need an image with a dash in it... it just pastes the image in and there's no post processing such as enlarging it.
But your last question is something I've been wondering about : could there be an easier way to put images in the text? Such as... using alias codes or something?
But your last question is something I've been wondering about : could there be an easier way to put images in the text? Such as... using alias codes or something?
Re: Inserting graphics into the text in NVL mode.
Yeah, I figured as much after messing with the code. I ended up making a couple different dashes, heh. And some ellipses.
Re: Inserting graphics into the text in NVL mode.
I'm going to guess that's a no to both the aliasing and being able to adjust image width in the tag a la HTML tags.
Re: Inserting graphics into the text in NVL mode.
*wonders if PyTom has a trigger on his username*....
I think he just missed the post ^_^. Let's wait some more
... or if needed, we/you can pm him.
I think he just missed the post ^_^. Let's wait some more
- PyTom
- Ren'Py Creator
- Posts: 15893
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Inserting graphics into the text in NVL mode.
No, no trigger on my username. There's no way of resizing images, or of aliasing images to give them shorter names. Image inclusion is meant to be a rare thing... if you really need lots of special characters, you should look at editing your font to include them. (For example, most fonts already include ‐, –, ‒, —, and ― characters, which should take care of the dashes.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
- Criptych
- Regular
- Posts: 87
- Joined: Sat Jun 23, 2007 9:19 am
- Projects: ALICE.NET
- Location: The other end of the internet.
- Contact:
Re: Inserting graphics into the text in NVL mode.
I suppose this is related:
You mentioned "editing your font to include" special characters; is there a way to temporarily switch fonts to get those special characters from another font?
For example, "What the {font=pottymouth.ttf}abcd{/font}!?"
(Not exactly my intent, but just an example.
)
You mentioned "editing your font to include" special characters; is there a way to temporarily switch fonts to get those special characters from another font?
For example, "What the {font=pottymouth.ttf}abcd{/font}!?"
(Not exactly my intent, but just an example.
- PyTom
- Ren'Py Creator
- Posts: 15893
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Inserting graphics into the text in NVL mode.
Yes, simply use the {font=foo.ttf}text{/font} text tag.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
Re: Inserting graphics into the text in NVL mode.
Mhhhh... so I guess an actual solution would be to create an SFont with regular characters AND special characters you wouldn't use otherwise assigned to little pictures... Like having Arial combined with Wingdings or something? ^^;
- Criptych
- Regular
- Posts: 87
- Joined: Sat Jun 23, 2007 9:19 am
- Projects: ALICE.NET
- Location: The other end of the internet.
- Contact:
Re: Inserting graphics into the text in NVL mode.
...Undocumented feature? Or did I just not read carefully enough?PyTom wrote:Yes, simply use the {font=foo.ttf}text{/font} text tag.
Thanks a lot, though.
Who is online
Users browsing this forum: _ticlock_

