Hello, I was wondering if there's a way to hide input text from the player with ******* or similar characters because I'm trying to create a fake log in interface for my game, but I at least want it to feel real.
I looked and there is something called stdiomask https://pypi.org/project/stdiomask/#files for python that does this (I'm not exactly sure how it works) but idk how I would go about using it in Ren'Py or if that's even possible.
If there is another way to do it or code examples, any help would be appreciated, Thanks!
Passwords hidden as Asterisks in renpy?
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.
-
- Newbie
- Posts: 8
- Joined: Tue Sep 17, 2019 8:21 pm
- Projects: memoria-machina.com
- Soundcloud: darxori
- itch: darxori
- Contact:
Passwords hidden as Asterisks in renpy?
CURRENT PROJECT:
https://www.memoria-machina.com/
https://www.memoria-machina.com/
- Ocelot
- Lemma-Class Veteran
- Posts: 2400
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: Passwords hidden as Asterisks in renpy?
If you want quick and dirty solution, you can use a font file that displays all characters as asterisks. Just take the font you want and replace all characters in it with asterisks using any font editor.
< < insert Rick Cook quote here > >
- Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
- Contact:
Re: Passwords hidden as Asterisks in renpy?
Or put the input in a fixed with a text (with solid background) directly over it that just shows * times the input length.
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
- PyTom
- Ren'Py Creator
- Posts: 16093
- 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: Passwords hidden as Asterisks in renpy?
I've added support for this to Ren'Py. It'll show up in tomorrow's nightly and the next 7.4.5 release.
With the change, it's possible to write:
With the change, it's possible to write:
Code: Select all
$ password = renpy.input("Enter Password:", mask="•")
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3791
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Passwords hidden as Asterisks in renpy?
I've personally never seen the point of masking passwords. If somebody is able to see your screen, surely they can see your hand typing on your keyboard too?
Personally, I dislike being unable to check that I've typed the password correctly, will you include a way for the player to disable or temporarily hide the mask so they can check?
Personally, I dislike being unable to check that I've typed the password correctly, will you include a way for the player to disable or temporarily hide the mask so they can check?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
- IrinaLazareva
- Veteran
- Posts: 399
- Joined: Wed Jun 08, 2016 1:49 pm
- Projects: Legacy
- Organization: SunShI
- Location: St.Petersburg, Russia
- Contact:
Re: Passwords hidden as Asterisks in renpy?
Thank you so much for this !
4 example...
Code: Select all
default sword = ""
default mkey = '12345'
default showpass = False
screen derparol():
frame:
align(.5,.5)
vbox:
textbutton '✘' action Quit(False) xalign 1.0 text_size 12
text 'Enter password:' xalign .5
input mask (None if showpass else '*') length 9 value VariableInputValue('sword', True, True)
hbox:
spacing 5
textbutton ('✘' if showpass else '✔') action ToggleVariable('showpass') text_size 14 text_color '#2f0'
text 'show password' size 15
key "K_RETURN" action If(sword==mkey, Return(), SetVariable('sword', ''))
label splashscreen:
call screen derparol
return
Who is online
Users browsing this forum: Bing [Bot], Google [Bot]