I'm challenging myself in creating an item generator.
Right now I'm creating 'templates' aka functions with a lot of love.graphics.print() functions.
I wanted to use string interpolation but all that did was made me confused and I wasn't sure how I would set the position of things and it was overall confusing for me.
Got the basic layout for a weapon.
Though I still haven't perfected on the resizing when some stuff isn't included.
What's everyone working on? (tigsource inspired)
- KingRecycle
- Prole
- Posts: 44
- Joined: Thu May 24, 2012 1:01 am
- Roland_Yonaba
- Inner party member
- Posts: 1563
- Joined: Tue Jun 21, 2011 6:08 pm
- Location: Ouagadougou (Burkina Faso)
- Contact:
Re: What's everyone working on? (tigsource inspired)
Great. Keep up the good job.
Well, try my Allen. Or at least, rip the function you need (see line 263)KingRecycle wrote: I wanted to use string interpolation but all that did was made me confused and I wasn't sure how I would set the position of things and it was overall confusing
Code: Select all
function _.substitute(str,value) return (str:gsub('%${*([%w]+)}*',value)) end
--Example
print(_.subtitute('value = ${value}',100))
- KingRecycle
- Prole
- Posts: 44
- Joined: Thu May 24, 2012 1:01 am
Re: What's everyone working on? (tigsource inspired)
Roland_Yonaba wrote:Great. Keep up the good job.
Well, try my Allen. Or at least, rip the function you need (see line 263)KingRecycle wrote: I wanted to use string interpolation but all that did was made me confused and I wasn't sure how I would set the position of things and it was overall confusingCode: Select all
function _.substitute(str,value) return (str:gsub('%${*([%w]+)}*',value)) end --Example print(_.subtitute('value = ${value}',100))
So if I wanted to run love.graphics.setColor() to change the color of specific text. How would I go about doing that?
Re: What's everyone working on? (tigsource inspired)
Look, that's the an old text problem/dilemma in LOVE. Preserve string vs divided txt strings for each color. Best way is get a to implement some instring tags in you string and parse your text for coloring changes. Not easy and require some work. But not let stay off-topic here. Open a thread for it. Also search see Robin's Rich Text and litearc message dialog lib.KingRecycle wrote:Roland_Yonaba wrote:Great. Keep up the good job.
Well, try my Allen. Or at least, rip the function you need (see line 263)KingRecycle wrote: I wanted to use string interpolation but all that did was made me confused and I wasn't sure how I would set the position of things and it was overall confusingCode: Select all
function _.substitute(str,value) return (str:gsub('%${*([%w]+)}*',value)) end --Example print(_.subtitute('value = ${value}',100))
So if I wanted to run love.graphics.setColor() to change the color of specific text. How would I go about doing that?
- Roland_Yonaba
- Inner party member
- Posts: 1563
- Joined: Tue Jun 21, 2011 6:08 pm
- Location: Ouagadougou (Burkina Faso)
- Contact:
Re: What's everyone working on? (tigsource inspired)
Oh in that case, as coffee said, Robin's richText is probably what you're looking for.KingRecycle wrote:So if I wanted to run love.graphics.setColor() to change the color of specific text. How would I go about doing that?
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: What's everyone working on? (tigsource inspired)
Yeah, that seems like a job for RichText. If you decide to use it, and you find a bug, please notify me, so I can fix it.
Help us help you: attach a .love.
Re: What's everyone working on? (tigsource inspired)
@KingRecycle: Where did you get that font? It looks wonderful.
Re: What's everyone working on? (tigsource inspired)
Hi there,
So much impressive stuff from everyone!
Here's a screenshot of my first foray into LÖVE. (It's supposed to be pixel-doubled but I shrunk it so it doesn't take up too much space.)
So much impressive stuff from everyone!
Here's a screenshot of my first foray into LÖVE. (It's supposed to be pixel-doubled but I shrunk it so it doesn't take up too much space.)
Re: What's everyone working on? (tigsource inspired)
Looks good, what is to do in this game ?Chèvre wrote:Hi there,
So much impressive stuff from everyone!
Here's a screenshot of my first foray into LÖVE. (It's supposed to be pixel-doubled but I shrunk it so it doesn't take up too much space.)
Re: What's everyone working on? (tigsource inspired)
You have to make rabbit stew Hit rabbits with your giant carrot and aim for the saucepan.Larsii30 wrote:Looks good, what is to do in this game ?Chèvre wrote:Hi there,
So much impressive stuff from everyone!
Here's a screenshot of my first foray into LÖVE. (It's supposed to be pixel-doubled but I shrunk it so it doesn't take up too much space.)
Who is online
Users browsing this forum: No registered users and 1 guest