Ms Windows style text buttons

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
FlipTopBin
Newbie
Posts: 15
Joined: Thu Apr 12, 2018 5:55 am
Contact:

Ms Windows style text buttons

#1 Post by FlipTopBin » Thu Apr 12, 2018 9:48 am

I am wondering if there is an easy way to make microsoft windows style clicky text buttons or do I have to handcraft imagebuttons every time?

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Ms Windows style text buttons

#2 Post by kivik » Thu Apr 12, 2018 10:12 am

I'd think you can definitely do it, depending on exactly which Windows Version button you're thinking of. The Windows 10 buttons are flat so it's definitely doable in text button.

Just define a style with the right font, padding, border and colours, then apply it to your text button and you're done :)

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3636
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Ms Windows style text buttons

#3 Post by Imperf3kt » Thu Apr 12, 2018 3:56 pm

As above, "Microsoft Windows" has hundreds of "button designs" that span across its entire life (Windows 1.01 looks horrible by the way)
Not to mention they were highly customisable throughout Windows xp to Windows 7

Can you give an example of which buttons you want to replicate?

Also, you could make a button base image, and layer text over top of it and combine it all into a single button. This way, you only need one image, the thing that changes is your text/code on the button. I don't recall what this method is called, unfortunately.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py

User avatar
xavimat
Eileen-Class Veteran
Posts: 1458
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Contact:

Re: Ms Windows style text buttons

#4 Post by xavimat » Fri Apr 13, 2018 4:42 am

Perfectly possible.
Use textbutton and define the text_font and the background idle and hover, selected idle and selected hover.
(Or maybe there is something that I don't understand...)

Code: Select all

screen buttontest():
    default test = False
    textbutton "Textbutton":
        align (.5,.5)
        text_font "comic_sans.ttf"
        idle_background Solid("#800")
        hover_background Solid("#f00")
        selected_idle_background Solid("#080")
        selected_hover_background Solid("#0f0")
        action ToggleScreenVariable("test", True, False)
Change the Solids with your images, or better, Frames, so your images can be scaled
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

Post Reply

Who is online

Users browsing this forum: Bing [Bot]