What's everyone working on? (tigsource inspired)

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
KingRecycle
Prole
Posts: 44
Joined: Thu May 24, 2012 1:01 am

Re: What's everyone working on? (tigsource inspired)

Post by KingRecycle »

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.

Image


Though I still haven't perfected on the resizing when some stuff isn't included.

Image
User avatar
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)

Post by Roland_Yonaba »

Great. Keep up the good job.
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
Well, try my Allen. Or at least, rip the function you need (see line 263)

Code: Select all

function _.substitute(str,value) return (str:gsub('%${*([%w]+)}*',value)) end

--Example
print(_.subtitute('value = ${value}',100))
User avatar
KingRecycle
Prole
Posts: 44
Joined: Thu May 24, 2012 1:01 am

Re: What's everyone working on? (tigsource inspired)

Post by KingRecycle »

Roland_Yonaba wrote:Great. Keep up the good job.
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
Well, try my Allen. Or at least, rip the function you need (see line 263)

Code: 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?
coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: What's everyone working on? (tigsource inspired)

Post by coffee »

KingRecycle wrote:
Roland_Yonaba wrote:Great. Keep up the good job.
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
Well, try my Allen. Or at least, rip the function you need (see line 263)

Code: 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?
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.
User avatar
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)

Post by Roland_Yonaba »

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?
Oh in that case, as coffee said, Robin's richText is probably what you're looking for.
User avatar
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)

Post by Robin »

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.
jonyzz
Prole
Posts: 48
Joined: Sun Sep 02, 2012 9:35 pm

Re: What's everyone working on? (tigsource inspired)

Post by jonyzz »

@KingRecycle: Where did you get that font? It looks wonderful.
User avatar
Chèvre
Prole
Posts: 16
Joined: Sun Sep 16, 2012 4:53 pm
Location: France

Re: What's everyone working on? (tigsource inspired)

Post by Chèvre »

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.)
Attachments
201209232002.png
201209232002.png (7.13 KiB) Viewed 3510 times
User avatar
Larsii30
Party member
Posts: 267
Joined: Sun Sep 11, 2011 9:36 am
Location: Germany

Re: What's everyone working on? (tigsource inspired)

Post by Larsii30 »

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.)
Looks good, what is to do in this game ?
User avatar
Chèvre
Prole
Posts: 16
Joined: Sun Sep 16, 2012 4:53 pm
Location: France

Re: What's everyone working on? (tigsource inspired)

Post by Chèvre »

Larsii30 wrote:
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.)
Looks good, what is to do in this game ?
You have to make rabbit stew ;) Hit rabbits with your giant carrot and aim for the saucepan.
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests