So i'm making my battle ui
I have name plates with only a set amount of Text room. What I am looking for is a character count type function. so that instead of the letters going off the space. it'll go "..." at the end of the character limit i set.
Way to check amount of space/characters?
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.
-
- Regular
- Posts: 156
- Joined: Tue Jun 02, 2009 8:56 pm
- Projects: Jewels of Sytinane
- Location: U.s.a.
- Contact:
Way to check amount of space/characters?
--- My DeviantArt.
Game in Progress for demo-teaser:
story(script) = 45%
sprites = 100%
programming(interface) = 35%
CGs = 0%
Backgrounds = 5%
Music/sound = 0%
Game in Progress for demo-teaser:
story(script) = 45%
sprites = 100%
programming(interface) = 35%
CGs = 0%
Backgrounds = 5%
Music/sound = 0%
- Aleema
- Lemma-Class Veteran
- Posts: 2677
- Joined: Fri May 23, 2008 2:11 pm
- Organization: happyB
- Tumblr: happybackwards
- Contact:
Re: Way to check amount of space/characters?
So easy you'll kick yourself:
Checks for the length of the string Name, if greater than 25 chars, reduce it to 20 chars and add an ellipsis. W's and other characters are pretty wide, so account for three of the widest characters when choosing your short length.
This is pure Python, so you should familiarize yourself with string operations.
Code: Select all
if len(name) > 25:
name = name[:20] + "..."
This is pure Python, so you should familiarize yourself with string operations.
-
- Regular
- Posts: 156
- Joined: Tue Jun 02, 2009 8:56 pm
- Projects: Jewels of Sytinane
- Location: U.s.a.
- Contact:
Re: Way to check amount of space/characters?
knew I should of looked on the python bit. XD
thanks <3 that was too easy.
thanks <3 that was too easy.
--- My DeviantArt.
Game in Progress for demo-teaser:
story(script) = 45%
sprites = 100%
programming(interface) = 35%
CGs = 0%
Backgrounds = 5%
Music/sound = 0%
Game in Progress for demo-teaser:
story(script) = 45%
sprites = 100%
programming(interface) = 35%
CGs = 0%
Backgrounds = 5%
Music/sound = 0%
Who is online
Users browsing this forum: Bing [Bot], Lucyper