Ren'Py Hi friends

U

User_286102

Guest
Guest
I've a problem with a method on renpy
I use atom
I want to create a menu in which i can read info about my characters ... but I dont know how to close the menu
I think it's easier to explain myself with an example of what i did :


screen buttonchar:
vbox xalign 0.02 yalign 0.02:
spacing 20
imagebutton auto "ICON/buttonchar":
action Call screen mychar

screen mychar:
add "bgchar"
textbutton "maria" action call screen maria.png
xalign 0.03
yalign 0.03
textbutton "pablo" action call screen pablo.png
xalign 0.09
yalign 0.03

and i continue like that as much as i've character

I dont know if what i did's ok and especially i can't to go back

this button appears always and i wish that the player can go in this menu when he want/need it, but how then to allow the player to leave this screen characters and to return to the same place of the history where he was when he opened this menu

I would be happy if someone can correct me and explain me how to get out of this and join the current story
or maybe show me the path of a tutorial that gives me a solution for the menus of this kind

i hope i managed to explain my problem well and sorry for my bad English
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,705
You can add a or in your "mychar" screen to close it, like that:
Code:
screen mychar:
    add "bgchar"
    textbutton "maria" action call screen maria.png
    xalign 0.03
    yalign 0.03
    textbutton "pablo" action call screen pablo.png
    xalign 0.09
    yalign 0.03 

    textbutton "Close" action Hide("mychar")

## or use imagebutton, but you need to create two state image, one named "close_idle.png" and another called "close_hover.png"

    imagebutton auto "close_%s.png" action Hide("mychar")
 
  • Like
Reactions: User_286102
U

User_286102

Guest
Guest
Thank you so much MGomez

Sadly, it still doesnt work!
the game launch but when i start a game a very big error code comes.

here is what i did, there is an error

screen buttonchar:
vbox xalign 0.02 yalign 0.20:
spacing 20
imagebutton auto "ICON/buttonchar":
action Call("mychar")

screen mychar:
add "CHAR/menuchar"
textbutton "jimena" action Call("jimena"):
xalign 0.03
yalign 0.03
textbutton "Close" action Hide("mychar"):
xalign 0.9
yalign 0.9

screen jimena:
add "CHAR/jimena"
textbutton "Close" action Hide("jimena"):
xalign 0.9
yalign 0.9



I've try a lot of things but i dont see my mistake.

if i put
action call screen("mychar")
error say me call screen it's not a key

What did you manage to find?
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,705
Try changing this part:
Code:
screen buttonchar:
    vbox xalign 0.02 yalign 0.20:
    spacing 20
    imagebutton auto "ICON/buttonchar_%s.png" action Show("mychar")
Remember that you need to have two images, one named "buttonchar_idle.png" and another named "buttonchar_hover.png" (extension isn't important, change it if you have jpg or webp format for your images)

And to facilitate to be able to help you, when you write code better to do it between these commands: [ CODE ] to start, and [ /CODE ] to end (without the spaces between CODE and brackets) :p
 
  • Like
Reactions: User_286102
U

User_286102

Guest
Guest
it progresses!!!
the game starts and it works but now i've a problem with the image CHAR/menuchar

this image not apear in the game, i've the button but instead of receiving the image menuchar i get a little message error at the top of my screen in game
he say, image ..... not found

i've this image in the good folder
this image is 1280x720 and jpg and i try with png both don't work

Code:
 label start:
    "Now seni know put a code in F95Zone
;)
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,705
I suppose you have the folder "CHAR" in "images", otherwise maybe that's why can't find it.
Also keep in mind that renpy is case sensitive, better to keep directories and file names in lowercase.

If that doesn't work for you, put a screenshot.

Code:
 label start:
    "Now seni know put a code in F95Zone
;)
:giggle:
 
  • Like
Reactions: User_286102
U

User_286102

Guest
Guest
I've try without MAJ "char/menuchar" dont work

i put menuchar img in image and delete the folder CHAR, rename all img in the script, and..........

THAT WORKS ............

OOOh yes, senor Gomez, MUCHAS GRACIAS Parcejo
 
  • Like
Reactions: Porcus Dev