How to put imagebuttons in DSE ?

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
stwkun
Regular
Posts: 82
Joined: Wed Jan 02, 2013 7:57 pm
Organization: Stw Projects
Contact:

How to put imagebuttons in DSE ?

#1 Post by stwkun »

The Dse code shows the choices in text, i want to change the text-choices for image to image-buttons. How can I do that?

I tried to put a image in the text-choice

Code: Select all

    dp_period("Aft", "afternoon_act")
    dp_choice("{image=heart.png}", "study")
    dp_choice("Hang Out\n", "hang")
but the problem is I don't know if the options is selected or not

Image

I want the image shows when is selected or not

User avatar
qirien
Miko-Class Veteran
Posts: 541
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
itch: qirien
Location: New Mexico, USA
Discord: qirien
Contact:

Re: How to put imagebuttons in DSE ?

#2 Post by qirien »

Hmm, if you want to use image buttons, probably the best way would be to modify the code directly in day_planner.rpy.

Where it says:

Code: Select all

textbutton name action SetField(store, this_period.var, curr_val)
you could change it to something like:

Code: Select all

$ button_name = name + "-%s.png"
imagebutton auto button_name action SetField(store, this_period.var, curr_val)
This will require that your buttons are named the same as your fields; for example, "Cut Class-idle.png" "Cut Class-hover.png" and "Cut Class-insensitive.png"
Finished games:
Image
Image
Image

User avatar
stwkun
Regular
Posts: 82
Joined: Wed Jan 02, 2013 7:57 pm
Organization: Stw Projects
Contact:

Re: How to put imagebuttons in DSE ?

#3 Post by stwkun »

I am using the old dse version :/ because the new dse have this problem :

when I enter to the options when the day planner appears (in the 1st time I run the game) appears this error message

Image

User avatar
qirien
Miko-Class Veteran
Posts: 541
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
itch: qirien
Location: New Mexico, USA
Discord: qirien
Contact:

Re: How to put imagebuttons in DSE ?

#4 Post by qirien »

Hmmm, I've never seen that error before... I can't seem to reproduce it, either. :-(
But... the error log you posted looks strange. At the bottom, it says you are using Ren'Py 6.99, but the error is coming from files in Ren'Py 6.18?

Can you try deleting persistent data and running it again? If there's a problem with the new DSE I definitely want to fix it!
Finished games:
Image
Image
Image

User avatar
stwkun
Regular
Posts: 82
Joined: Wed Jan 02, 2013 7:57 pm
Organization: Stw Projects
Contact:

Re: How to put imagebuttons in DSE ?

#5 Post by stwkun »

I updated directly from renpy launch so the files directory keeps the old name (renpy 6.18)

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: How to put imagebuttons in DSE ?

#6 Post by PyTom »

It's probably a somehow-corrupt savefile. Edit: 6.99.2 will detect and fix this.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
qirien
Miko-Class Veteran
Posts: 541
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
itch: qirien
Location: New Mexico, USA
Discord: qirien
Contact:

Re: How to put imagebuttons in DSE ?

#7 Post by qirien »

OK, thanks PyTom. stwkun, in the meantime, you could try deleting your save game files for the DSE in its game/saves directory.
Finished games:
Image
Image
Image

User avatar
stwkun
Regular
Posts: 82
Joined: Wed Jan 02, 2013 7:57 pm
Organization: Stw Projects
Contact:

Re: How to put imagebuttons in DSE ?

#8 Post by stwkun »

(Qirien) I tried to follow your instructions but I couldn't implement the image buttons (It's kind of hard for me). Last question, In the New Dse , how can I make the background doesn't appears dark? (when appears the activities options)

(Pytom) Thanks for your support. I'll wait until the next release

User avatar
qirien
Miko-Class Veteran
Posts: 541
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
itch: qirien
Location: New Mexico, USA
Discord: qirien
Contact:

Re: How to put imagebuttons in DSE ?

#9 Post by qirien »

Sorry about that, image buttons can be kind of complicated... :-/

But, anyway, about the background. The default background is taken from whatever theme you've chosen. Are you talking about the black area behind the stats and the day planner?

If so, there are two ways to change that. One is to change the style of all the windows in the game. You can do this by putting something like this in your styles.rpy:

Code: Select all

style window:
    background "#00a6"
This will give every window (including the DSE and text boxes) a slightly-transparent dark blue background.

If you only want to change the DSE's window, then let's call our window something else and tell the DSE to use that. So instead of calling it "window", let's call it "dse_window" like this:

Code: Select all

# Window style for the DSE
style dse_window:
    background "#00a6"
Now we need to tell the DSE to use it. So open up day_planner.rpy, and find where it says "screen day_planner(periods)". You see that it says to create a window, and in that window put the stats screen and the planner screen. So to tell that window to use our style we just made, we'll change it from this:

Code: Select all

screen day_planner(periods):
    # indicate to Ren'Py engine that this is a choice point
    $ renpy.choice_for_skipping()
    window:
        use display_stats(True, True, True, True)
        use display_planner(periods)     
to this:

Code: Select all

screen day_planner(periods):
    # indicate to Ren'Py engine that this is a choice point
    $ renpy.choice_for_skipping()
    window:
        style "dse_window"
        use display_stats(True, True, True, True)
        use display_planner(periods)     
Finished games:
Image
Image
Image

User avatar
stwkun
Regular
Posts: 82
Joined: Wed Jan 02, 2013 7:57 pm
Organization: Stw Projects
Contact:

Re: How to put imagebuttons in DSE ?

#10 Post by stwkun »

Thank you :D :D , It solved my last question.

For the "image buttons" the solution that I found was at the beginning of the topic, well it's another way to do, not the best solution but it works. 8)

Code: Select all

dp_choice("{image=heart.png} ✓", "study")
The solution, adding a check "✓" and using small image can customising the Dse appearance.

Image

Well, It's a temporaly solution until We found the way to make the "image button" works in Dse system

User avatar
qirien
Miko-Class Veteran
Posts: 541
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
itch: qirien
Location: New Mexico, USA
Discord: qirien
Contact:

Re: How to put imagebuttons in DSE ?

#11 Post by qirien »

Glad I could help!
Finished games:
Image
Image
Image

Post Reply

Who is online

Users browsing this forum: No registered users