What's the best practices for implementing them?
Edit: found the answer to this on my own.
Can I use sprite a sheet? If so, how?
What are some good emotions to use as tags?
Code: Select all
add SideImage() xalign 0.0 yalign 1.0Code: Select all
show character_1_sprite
character_1 "character_1 dialogue with default mood"
hide character_1_sprite
show character_2_sprite happy
character_2 "character_2 dialogue with happy mood"
hide character_2_sprite happy
Code: Select all
character_1 "character_1 dialogue with default mood"
character_2 happy "character_2 dialogue with happy mood"
Code: Select all
define e = Character("Eileen", image="eileen")
# Normal sprites
image eileen = "eileen.png"
image eileen happy = "eileen_happy.png"
# Side sprites
image side eileen = "side_eileen.png"
image side eileen happy = "side_eileen_happy.png"
Huh?
Now, I got it. Interesting, although it is confusing for me. As far as I know, a bigger image is not efficient in terms of memory usage. I am not sure but I believe that for RenPy engine this additional cropping should result in higher processor usage. I am also hesitant about "usability" since it slightly complicate the image definition. So, it seems to me that this concept of the sprite sheet is not efficient.arlj11 wrote: ↑Mon Feb 01, 2021 10:01 amA sprite sheet is where you have several sprites in one image layout in a way that the game just looks at one area of the image when called. it uses crop sections. it saves space because everything is in one file.
This cookbook is the only one I found that may help. viewtopic.php?f=51&t=23546#p294271
I agree. Actually, I did not imply that your question should be more specific. Based on your reply, it seemed to me you were asking something more specific. Or, I just did not get the questions.
Code: Select all
image side pikachu smile = Crop((0, 0, 40, 40),"images/spritesheet.png") ## The numbers are: (X, Y, Width, Height)
image side pikachu happy = Crop((40, 0, 40, 40),"images/spritesheet.png") ## Crop moves 40 pixels on the x axis to the next emotion.
Code: Select all
image side pikachu blink:
"images/spritesheet.png" ## Remember to put the image location name here. Or else it's invisible. I forget it so often.
crop (0, 0, 40, 40) ## Crop by (X, Y, Width, Height)
pause 2.0
crop (40, 0, 40, 40) ## Crop moves 40 pixels on the x axis.
pause 1.0
repeat
Code: Select all
image side pikachu blink2:
crop_relative True ## Tells Ren'py to use floats (percentages) instead of pixels.
"images/spritesheet.png"
crop (0.0, 0.0, .50, 1.0) ## Crop by (X, Y, Width, Height)
pause 2.0
crop (.50, 0.0, .50, 1.0) ## Make crop move 50% on the x axis.
pause 1.0
repeat
Code: Select all
transform blink:
crop_relative True
crop (0.0, 0.0, .25, 1.0) ## Eyes open
pause 0.2
## Chooses a random time before blinking...
choice:
pause 2.0
choice:
pause 4.0
choice:
pause 6.0
choice:
pause 8.0
crop (.25, 0.0, .25, 1.0) ## Blink graphic
pause 0.2
repeat
## Define all the images that use the same blink animation.
image side pikachu smile_blink = At("images/spritesheet.png", blink)
image side bulbasaur smile_blink = At("images/spritesheet_bulbasaur.png", blink)
image side charmander smile_blink = At("images/spritesheet_charmander.png", blink)
image side squirtle smile_blink = At("images/spritesheet_squirtle.png", blink)

Users browsing this forum: Bing [Bot]