How to position a side image [SOLVED]

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
aussieducky
Regular
Posts: 31
Joined: Sat Dec 27, 2014 8:43 pm
Projects: =
Tumblr: aussiebunny
Contact:

How to position a side image [SOLVED]

#1 Post by aussieducky »

I want to move my character's side image over a bit so I can see her dialogue, but I can't figure out how x_x. I've looked at tutorials, but I just end up getting confused.

My code:

Code: Select all

define h = Character ('Haruko', window_left_padding=160, show_side_image = "side_HarukoSpriteBG.png", color="#ffb1ea")
I think I need to define a position or something, but I'm not sure how to do that, or how to put it into the coding :/
Attachments
moveover.png
Last edited by aussieducky on Fri Feb 13, 2015 7:01 am, edited 1 time in total.
I am a teenager who would like, very much, to finish a visual novel ;D

I don't know much about coding, but I'll try not to be a bother.

Currently working on: "Blackout"

User avatar
Dekeve
Newbie
Posts: 20
Joined: Thu Feb 05, 2015 9:29 pm
Tumblr: pyrocatproductions
Deviantart: dekeve
Contact:

Re: How to position a side image

#2 Post by Dekeve »

You need to define it this way

Code: Select all

define e = Character("Eileen", image="eileen")

image side eileen = "side_eileen_happy.png"
Replace "eileen" with the name of your character and "side_eileen_happy.png" with the name of your side image file.

Then add this

Code: Select all

init python:
     style.window.padding_left = 160
     add SideImage() xalign 0.0 yalign 1.0
Edit: I also recommend that you take a look at this documentation page on the subject as well- Side Images

User avatar
aussieducky
Regular
Posts: 31
Joined: Sat Dec 27, 2014 8:43 pm
Projects: =
Tumblr: aussiebunny
Contact:

Re: How to position a side image

#3 Post by aussieducky »

Dekeve wrote:You need to define it this way

Code: Select all

define e = Character("Eileen", image="eileen")

image side eileen = "side_eileen_happy.png"
Replace "eileen" with the name of your character and "side_eileen_happy.png" with the name of your side image file.

Then add this

Code: Select all

init python:
     style.window.padding_left = 160
     add SideImage() xalign 0.0 yalign 1.0
Edit: I also recommend that you take a look at this documentation page on the subject as well- Side Images

So I did it:

Code: Select all

define h = Character ('Haruko', image=haru, color="#ffb1ea")
image side haru = "side_HarukoSpriteBG.png"

init python:
     style.window.padding_left = 160
     add SideImage() xalign 0.0 yalign 1.0
And now ren'y says the () bit is an invalid syntax. Do I have to put something in the barracks? I tried putting "haru" in but that wouldn't work.
I am a teenager who would like, very much, to finish a visual novel ;D

I don't know much about coding, but I'll try not to be a bother.

Currently working on: "Blackout"

User avatar
Dekeve
Newbie
Posts: 20
Joined: Thu Feb 05, 2015 9:29 pm
Tumblr: pyrocatproductions
Deviantart: dekeve
Contact:

Re: How to position a side image

#4 Post by Dekeve »

Strange, I'm not exactly sure, but you can also try this:

Code: Select all

init:
define h = Character('Haruko', window_left_padding=160, show_side_image = Image("side_HarukoSpriteBG.png", xalign = 0.0, yalign = 1.0) 

User avatar
aussieducky
Regular
Posts: 31
Joined: Sat Dec 27, 2014 8:43 pm
Projects: =
Tumblr: aussiebunny
Contact:

Re: How to position a side image

#5 Post by aussieducky »

Dekeve wrote:Strange, I'm not exactly sure, but you can also try this:

Code: Select all

init:
define h = Character('Haruko', window_left_padding=160, show_side_image = Image("side_HarukoSpriteBG.png", xalign = 0.0, yalign = 1.0) 
That didn't work either :/ The game won't start, just comes up with an error screen.
Attachments
nope.png
I am a teenager who would like, very much, to finish a visual novel ;D

I don't know much about coding, but I'll try not to be a bother.

Currently working on: "Blackout"

User avatar
Dekeve
Newbie
Posts: 20
Joined: Thu Feb 05, 2015 9:29 pm
Tumblr: pyrocatproductions
Deviantart: dekeve
Contact:

Re: How to position a side image

#6 Post by Dekeve »

Oh my, I'm sorry! I'm a bit tried tonight.

I forgot if you have "init:" you have to use python code

just replace define with a $

so it should be

Code: Select all

init:
$ h = Character('Haruko', window_left_padding=160, show_side_image = Image("side_HarukoSpriteBG.png", xalign = 0.0, yalign = 1.0)
That should work, I hope. Sorry, I've made a mess of this and I hope I haven't confused you more.

User avatar
aussieducky
Regular
Posts: 31
Joined: Sat Dec 27, 2014 8:43 pm
Projects: =
Tumblr: aussiebunny
Contact:

Re: How to position a side image

#7 Post by aussieducky »

Dekeve wrote:Oh my, I'm sorry! I'm a bit tried tonight.

I forgot if you have "init:" you have to use python code

just replace define with a $

so it should be

Code: Select all

init:
$ h = Character('Haruko', window_left_padding=160, show_side_image = Image("side_HarukoSpriteBG.png", xalign = 0.0, yalign = 1.0)
That should work, I hope. Sorry, I've made a mess of this and I hope I haven't confused you more.
It's fine! We all stuff up sometimes and I really appreciate all the time you're taking to help me out!

But unfortunately, it's still not working :/

Am I suppose to put this in the Script or somewhere else? Because I'm getting the same error as before.

My coding:

Code: Select all

# Declare characters used by this game.

define kitty = Character ('Kitty', color="#ff8665")
define ser = Character ('Servant', color="#ffd894")
define K = Character ('Karl', color="#ffc824")
define lt = Character ('Lady Tigress', color="#ff6201")

init:
$ h = Character('Haruko', window_left_padding=160, show_side_image = Image("side_HarukoSpriteBG.png", xalign = 0.0, yalign = 1.0)
Am I suppose to put the code somewhere else?
Attachments
Untitled.png
I am a teenager who would like, very much, to finish a visual novel ;D

I don't know much about coding, but I'll try not to be a bother.

Currently working on: "Blackout"

User avatar
Dekeve
Newbie
Posts: 20
Joined: Thu Feb 05, 2015 9:29 pm
Tumblr: pyrocatproductions
Deviantart: dekeve
Contact:

Re: How to position a side image

#8 Post by Dekeve »

Wow it just hit me, I completely missed it.

Ok first make sure the that line of code (under the "init:") is indented 4 spaces from the left edge. Then add a ) at the very end so there are two parenthesis, like this ))

Code: Select all

$ h = Character('Haruko', window_left_padding=160, show_side_image = Image("side_HarukoSpriteBG.png", xalign = 0.0, yalign = 1.0))
If that doesn't work then, I have no idea. :(

User avatar
aussieducky
Regular
Posts: 31
Joined: Sat Dec 27, 2014 8:43 pm
Projects: =
Tumblr: aussiebunny
Contact:

Re: How to position a side image

#9 Post by aussieducky »

Dekeve wrote:Wow it just hit me, I completely missed it.

Ok first make sure the that line of code (under the "init:") is indented 4 spaces from the left edge. Then add a ) at the very end so there are two parenthesis, like this ))

Code: Select all

$ h = Character('Haruko', window_left_padding=160, show_side_image = Image("side_HarukoSpriteBG.png", xalign = 0.0, yalign = 1.0))
If that doesn't work then, I have no idea. :(
Well, I'm not getting an error image any more. But the sprite itself is still covering the text. I changed the numbers a few times, but it never moved.

>.<

Have you get any other ideas? :c
Attachments
lord.png
I am a teenager who would like, very much, to finish a visual novel ;D

I don't know much about coding, but I'll try not to be a bother.

Currently working on: "Blackout"

User avatar
lilyrose
Regular
Posts: 104
Joined: Tue Oct 09, 2012 7:33 pm
Location: Texas
Contact:

Re: How to position a side image

#10 Post by lilyrose »

Well this may sound kind of silly but you're image, does it have a lot of extra space on the side? Meaning does the actual image itself cut off a little before the lines start or did you create your image in the middle of a square and leave it like that? That was an issue with me a while back ^.^"
~ You know I used to be able to leap tall buildings using a jetpack? Then I got shot in the leg with an arrow T.T ~

User avatar
aussieducky
Regular
Posts: 31
Joined: Sat Dec 27, 2014 8:43 pm
Projects: =
Tumblr: aussiebunny
Contact:

Re: How to position a side image [SOLVED!]

#11 Post by aussieducky »

lilyrose wrote:Well this may sound kind of silly but you're image, does it have a lot of extra space on the side? Meaning does the actual image itself cut off a little before the lines start or did you create your image in the middle of a square and leave it like that? That was an issue with me a while back ^.^"
Any suggestion is brilliant so thanks for replying :D

But yeah, actually! I initially started with a canvas the same size as the game screen (800 by 600) and drew the sprite in the corner, then made the background transparent. Is that what the problem is?

EDIT: OMG IT WORKED. I just resized the image and now it fitted perfectly :shock:

Thanks for all the help guys! <3
I am a teenager who would like, very much, to finish a visual novel ;D

I don't know much about coding, but I'll try not to be a bother.

Currently working on: "Blackout"

User avatar
Dekeve
Newbie
Posts: 20
Joined: Thu Feb 05, 2015 9:29 pm
Tumblr: pyrocatproductions
Deviantart: dekeve
Contact:

Re: How to position a side image

#12 Post by Dekeve »

lilyrose wrote:Well this may sound kind of silly but you're image, does it have a lot of extra space on the side? Meaning does the actual image itself cut off a little before the lines start or did you create your image in the middle of a square and leave it like that? That was an issue with me a while back ^.^"
You know I had started to wonder that myself and I just quick replied, suggesting we have a look at the sprite itself, but you beat me too it! Nice job!
EDIT: OMG IT WORKED. I just resized the image and now it fitted perfectly :shock:

Thanks for all the help guys! <3
Your welcome! I didn't mean to drag that out. But glad you got it fixed. Good luck with the rest of your game!

User avatar
aussieducky
Regular
Posts: 31
Joined: Sat Dec 27, 2014 8:43 pm
Projects: =
Tumblr: aussiebunny
Contact:

Re: How to position a side image

#13 Post by aussieducky »

Your welcome! I didn't mean to drag that out. But glad you got it fixed. Good luck with the rest of your game!
I really appreciated the help! In the end it was my image file that dragged everything out :oops:

Thank you!
I am a teenager who would like, very much, to finish a visual novel ;D

I don't know much about coding, but I'll try not to be a bother.

Currently working on: "Blackout"

User avatar
lilyrose
Regular
Posts: 104
Joined: Tue Oct 09, 2012 7:33 pm
Location: Texas
Contact:

Re: How to position a side image [SOLVED]

#14 Post by lilyrose »

:) glad to be of help :)
~ You know I used to be able to leap tall buildings using a jetpack? Then I got shot in the leg with an arrow T.T ~

Post Reply

Who is online

Users browsing this forum: Bing [Bot], piinkpuddiin, snotwurm