How do I add a side image to my game??
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.
-
- Regular
- Posts: 43
- Joined: Wed Jun 01, 2011 12:57 am
- Projects: Love Struck (GxB)
- Location: A small apartment, in a small city, somewhere in the planet.
- Contact:
How do I add a side image to my game??
Sorry if other people have already asked this question, but I can't make it work no matter what I do.
I look it up in the forum and ren'py tutorials, but the side image won't show went I launch my game. I was wondering if someone can help me.
I look it up in the forum and ren'py tutorials, but the side image won't show went I launch my game. I was wondering if someone can help me.
-
- Veteran
- Posts: 279
- Joined: Thu Jul 14, 2011 1:50 pm
- Organization: TwinTurtle Games
- Contact:
Re: How do I add a side image to my game??
Code: Select all
image side e = ("Eileen.png")
define e = Character(show_side_image=Image("Eileen.png", xalign=1.0, yalign=1.0))
I've swapped accounts to CheeryMoya, so this account is no longer in use. Refer to the new account if you want to contact me.
Twinturtle Games Website
Twinturtle Games Website
- Gear
- Miko-Class Veteran
- Posts: 764
- Joined: Tue Apr 05, 2011 10:15 pm
- Projects: Tempestus Sum
- Organization: Xenokos Interactive
- IRC Nick: Gear
- Skype: Skye.Gear
- Location: Grand Prairie, TX
- Contact:
Re: How do I add a side image to my game??
This may sound simple, but make sure you check that the file name is correct and in the folder it's supposed to be. The file names may be case-sensitive as well, so double checking that may help.
The best reason to get up in the morning is to outdo yourself: to do it better than you've ever done it before. But if you haven't done it better by nightfall... look at your globe and pick a spot: it's always morning somewhere.
Re: How do I add a side image to my game??
This works for me. Not to hijack the thread, but could someone point me in the right direction if I want to a) animate the side image and b) have the text wrap around the side image (currently the side image appears on top of the text). Are 'screens' the bit I need to be reading up on?
Re: How do I add a side image to my game??
Make an animated displayable using ATL and put its name inside your code instead of filename of your side image.a) animate the side image
http://www.renpy.org/doc/html/atl.html# ... -atl-block
You need to set textbox paddings for you characters, like in FAQ exampleb) have the text wrap around the side image (currently the side image appears on top of the text)
http://www.renpy.org/wiki/renpy/FAQ#How ... y_speak.3F
Re: How do I add a side image to my game??
Both tips work perfectly, thanks!
But I'm having issues getting both to work at the same time.
Two issues with this:
- the image is at the default position of top left. I can't figure out where to put the xalign/yalign parameters?
- other than that, it appears as I'd expect, animated and correctly padded, but, after I click to continue, I get:
Any suggestions?
But I'm having issues getting both to work at the same time.
Code: Select all
#mika on the left
define ml = Character('Mika', window_left_padding=160, show_side_image="mt", color="#c8ffc8")
image mt: # Mika's talking head
"mika_talkC.png"
pause 0.20
"mika_talkB.png"
pause 0.20
repeat
mt "hi there, my head should be somewhere on the left and the text to the right of it"
- the image is at the default position of top left. I can't figure out where to put the xalign/yalign parameters?
- other than that, it appears as I'd expect, animated and correctly padded, but, after I click to continue, I get:
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 108, in script
ml "and this is finally ML asda sdas dasd asd asd"
AttributeError: 'NoneType' object has no attribute '_hide'
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "C:\Program Files (x86)\renpy-6.12.2\renpy\execution.py", line 261, in run
File "C:\Program Files (x86)\renpy-6.12.2\renpy\ast.py", line 396, in execute
File "C:\Program Files (x86)\renpy-6.12.2\renpy\exports.py", line 684, in say
File "C:\Program Files (x86)\renpy-6.12.2\renpy\character.py", line 765, in __call__
File "C:\Program Files (x86)\renpy-6.12.2\renpy\character.py", line 661, in do_display
File "C:\Program Files (x86)\renpy-6.12.2\renpy\character.py", line 468, in display_say
File "C:\Program Files (x86)\renpy-6.12.2\renpy\ui.py", line 236, in interact
File "C:\Program Files (x86)\renpy-6.12.2\renpy\display\core.py", line 1667, in interact
File "C:\Program Files (x86)\renpy-6.12.2\renpy\display\core.py", line 555, in replace_transient
File "C:\Program Files (x86)\renpy-6.12.2\renpy\display\core.py", line 825, in remove
File "C:\Program Files (x86)\renpy-6.12.2\renpy\display\core.py", line 753, in hide_or_replace
File "C:\Program Files (x86)\renpy-6.12.2\renpy\display\screen.py", line 200, in _hide
File "C:\Program Files (x86)\renpy-6.12.2\renpy\display\motion.py", line 636, in _hide
AttributeError: 'NoneType' object has no attribute '_hide'
Any suggestions?
Re: How do I add a side image to my game??
Hi.
I'm new here. I did what you suggest for adding a figure to the text of my character, but I have a problem with the size of the side image. So I change the size before.
I tried the code:
but I have problem with the alignement. It is located at the top left of the screen, and not at the bottom.
So, if I change the size of the image, the alignment is modiffied.
Could you help me, please?
I'm new here. I did what you suggest for adding a figure to the text of my character, but I have a problem with the size of the side image. So I change the size before.
I tried the code:
Code: Select all
image alice=Image(im.FactorScale("alice-in-wonderland-2010.jpg", 0.5,0.5), xalign=0.0, yalign=1.0)
define s = Character('Alice',window_left_padding=200,
show_side_image="alice")
So, if I change the size of the image, the alignment is modiffied.
Could you help me, please?
Re: How do I add a side image to my game??
I see Aki solved his problem in another thread, and I also solved one of my problems. Here's how I got it to work:
But I still get the "_hide" error when I click to continue....no clue about that. Any help appreciated....
Code: Select all
define ml = Character('Mika', window_left_padding=165, show_side_image="mtl", color="#c8ffc8")
image mtl: # Mika's talking head
xalign 0.0 yalign 1.0
"mika_talkC.png"
pause 0.20
"mika_talkB.png"
pause 0.20
repeat
ml "I'm on the left now, animated and the text has the correct padding!"
Re: How do I add a side image to my game??
Hi, tentacle.
I just solved that. You don¡t have to write show_side_image in the definition of the character. You give the tag eileen to the image.
Then, you add the image side you want, resized.
To call it just write the name of the side image after the character and before the text.
Here you have the code:
I hope it helps
BTW, I'm a she
I just solved that. You don¡t have to write show_side_image in the definition of the character. You give the tag eileen to the image.
Then, you add the image side you want, resized.
To call it just write the name of the side image after the character and before the text.
Here you have the code:
Code: Select all
define e = Character("Eileen", window_left_padding=165, image="eileen")
image side eileen happy = im.FactorScale("side_eileen_happy.png", 0.5,0.5)
label start:
e happy concerned "And this one is point B."
BTW, I'm a she
Re: How do I add a side image to my game??
Oopsaki wrote:BTW, I'm a she
Thanks. What you suggest works, but it seems the xalign and yalign are not respected, the image is instead the default xalign 0.0 yalign 1.0 position!
Code: Select all
# ml is our character (Mika) with an imade that should be on the left at xalign 0.0 and yalign 0.925
define ml = Character('Mika', window_left_padding=165, image="ml", color="#c8ffc8")
image side ml talking: # Mika's talking head
xalign 0.0 yalign 0.925
"mika_talkC.png"
pause 0.20
"mika_talkB.png"
pause 0.20
repeat
ml talking "Everything works, except the xalign/yalign are ignored!!"
If I do it your way there's no crash but alignment is ignored.....
Re: How do I add a side image to my game??
Yes, I have problems with the alignments too.
Could it work with ...
Could it work with ...
Code: Select all
image side eileen happy = Image(im.FactorScale("side_eileen_happy.png", 0.5,0.5)
, xalign=0.0 yalign=0.925))
Re: How do I add a side image to my game??
I couldn't get it working. So to work around it I'm not using side images, instead I just show and hide the image each time...a little extra typing but I can survive!
So for example I have the normal character definition for when I want the character to speak without any image:
And if I want the image on the side I use this that adds space to the left for the image:
Then I define the image ml with alignments:
Then I use it like so:
So, this way everything works, it just means some extra typing. I'm sure there's a better way, but I couldn't figure it out.
So for example I have the normal character definition for when I want the character to speak without any image:
Code: Select all
define m = Character('Mika', color="#c8ffc8")
Code: Select all
define ml = Character('Mika', window_left_padding=165, color="#c8ffc8")
Code: Select all
image m left talking:
xalign 0.0 yalign 0.925
"mika_talkC.png"
pause 0.20
"mika_talkB.png"
pause 0.20
repeat
Code: Select all
m "Hi, here I have no image"
show m left talking
ml "And now you can see me talking to the left"
hide m
Re: How do I add a side image to my game??
Hi guys! Since I am trying to do this now, I want a side image to change expressions during certain situations, how do I go about doing that?
Thank you for the coding help it's really been a wonderful tutorial.
Thank you for the coding help it's really been a wonderful tutorial.
Re: How do I add a side image to my game??
Just one more question...
So there is that, and then I also have
Would that work? I mean I don't mind having to type A or Ae for typing words out if it gets the job done.
Gonna go try it out!
Code: Select all
image side A = ("Amelia-Normal.png")
define A = Character(show_side_image=Image("Amelia-Normal.png", xalign=1.0, yalign=1.0))
Code: Select all
image side Ae = ("Amelia-Exasperated.png")
define Ae = Character(show_side_image=Image("Amelia-Exasperated.png", xalign=1.0, yalign=1.0))
Would that work? I mean I don't mind having to type A or Ae for typing words out if it gets the job done.
Gonna go try it out!
- Azure_Flute
- Regular
- Posts: 26
- Joined: Fri Apr 04, 2014 7:12 pm
- Contact:
Re: How do I add a side image to my game??
How about this then?
Code: Select all
define A = Character('Michi', color="#c8ffc8", image = "Michi", window_left_padding=175)
image side Michi = ("mnormal.png")
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot]