How do I position a Character sprite?
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: 161
- Joined: Wed Feb 19, 2014 5:05 pm
- Completed: Mage Wars
- Projects: Falling Star
- Organization: Star Guide
- Contact:
How do I position a Character sprite?
I've looked at the tutorials but they seriously confuse me. So does anyone know how to re-position the characters when you have more than one at the same time? Please and thank you.
- curry nochi rice
- Miko-Class Veteran
- Posts: 746
- Joined: Sat Mar 27, 2010 3:12 am
- Projects: Delicatessen, Whom to Notice, Start of Something, Love Sorcery
- Organization: Circle Cosine
- IRC Nick: Curry
- Skype: after.curry.rice
- itch: project-rothera
- Contact:
Re: How do I position a Character sprite?
you could do:dmasterxd wrote:I've looked at the tutorials but they seriously confuse me. So does anyone know how to re-position the characters when you have more than one at the same time? Please and thank you.
Code: Select all
show character1 at center
show character2 at left
show character3 at right
## re-positioning
show character1 at right with moveright
show character2 at center with moveleft
## center, left. and right are already defined at 00definitions.rpy
or you could initiate/define your own positions in an init block:
Code: Select all
init:
$ rightsmile = Position(xpos=1.0, xanchor="right", ypos=0.55, yanchor="left")
Code: Select all
label start:
show inori smile at rightsmile
-
- Regular
- Posts: 161
- Joined: Wed Feb 19, 2014 5:05 pm
- Completed: Mage Wars
- Projects: Falling Star
- Organization: Star Guide
- Contact:
Re: How do I position a Character sprite?
Hey thanks for the help! It worked!curry nochi rice wrote:you could do:dmasterxd wrote:I've looked at the tutorials but they seriously confuse me. So does anyone know how to re-position the characters when you have more than one at the same time? Please and thank you.
I think there was a behind statement but I don't quite remember how to use it.Code: Select all
show character1 at center show character2 at left show character3 at right ## re-positioning show character1 at right with moveright show character2 at center with moveleft ## center, left. and right are already defined at 00definitions.rpy
or you could initiate/define your own positions in an init block:and do it like:Code: Select all
init: $ rightsmile = Position(xpos=1.0, xanchor="right", ypos=0.55, yanchor="left")
hope this helps >.<Code: Select all
label start: show inori smile at rightsmile
- Steamgirl
- Veteran
- Posts: 322
- Joined: Sat Jul 28, 2012 4:39 am
- Completed: My Cup of Coffee, Queen at Arms (co-wrote a battle scene)
- Projects: Stranded Hearts, Emma: A Lady's Maid
- Deviantart: steamgirlgame
- Contact:
Re: How do I position a Character sprite?
These are ones I tend to use:
Put this at the top of the script
Then in your game use the following to slide them into view or move them to a different position.
with moveleft / moveright also work, as posted above.
Use the following to make them leave the screen:
Put this at the top of the script
Code: Select all
init:
$ midright = Position(xalign=0.75)
$ midleft = Position(xalign=0.25)
$ edgeright = Position(xpos=0.9,xanchor=0.5)
$ edgeleft= Position(xpos=0.1,xanchor=0.5)
Code: Select all
show your_character1 at midleft with easeinleft
show your_character2 at edgeright with easeinright
Use the following to make them leave the screen:
Code: Select all
hide your_character1 with moveoutleft
Hobby Projects: Stranded Hearts | Emma: A Lady's Maid | My Cup of Coffee: The Trouble with Earl Grey
-
- Regular
- Posts: 161
- Joined: Wed Feb 19, 2014 5:05 pm
- Completed: Mage Wars
- Projects: Falling Star
- Organization: Star Guide
- Contact:
Re: How do I position a Character sprite?
Hey thanks, yours helped also! Oh yea this game is gonna be awesome!Steamgirl wrote:These are ones I tend to use:
Put this at the top of the scriptThen in your game use the following to slide them into view or move them to a different position.Code: Select all
init: $ midright = Position(xalign=0.75) $ midleft = Position(xalign=0.25) $ edgeright = Position(xpos=0.9,xanchor=0.5) $ edgeleft= Position(xpos=0.1,xanchor=0.5)
with moveleft / moveright also work, as posted above.Code: Select all
show your_character1 at midleft with easeinleft show your_character2 at edgeright with easeinright
Use the following to make them leave the screen:Code: Select all
hide your_character1 with moveoutleft
-
- Lemma-Class Veteran
- Posts: 2299
- Joined: Mon Feb 06, 2012 9:50 pm
- Completed: Icebound, Selenon Rising Ep. 1-2
- Projects: Selenon Rising Ep. 3-4
- Organization: Fastermind Games
- Deviantart: sundownkid
- Location: NYC
- Contact:
Re: How do I position a Character sprite?
You can also define a transform and make any character position you want that way. For example:
It's a slightly easier method than putting it in the init code.
Code: Select all
transform left:
xalign 0.2
yalign 1.0
transform right:
xalign 0.8
yalign 1.0
Who is online
Users browsing this forum: No registered users