Text

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
intensity
Prole
Posts: 8
Joined: Wed Sep 29, 2010 8:26 pm

Text

Post by intensity »

Is there a way to edit the text and position of a love.graphics.print() string? If not is there another type of onscreen text?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Text

Post by Robin »

How familiar are you with Lua/programming in general?

You see, for that purpose variables are used. If you know how to program, there's your answer. If not, I'd recommend learning some basic programming skills first. :)
Help us help you: attach a .love.
intensity
Prole
Posts: 8
Joined: Wed Sep 29, 2010 8:26 pm

Re: Text

Post by intensity »

I've been using Lua for about a year, but I just downloaded Love. Are you saying love.graphics.print() returns the text object?
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: Text

Post by Taehl »

No, it's a function. You pass it the parameters of text and position.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Text

Post by Robin »

intensity wrote:I've been using Lua for about a year, but I just downloaded Love. Are you saying love.graphics.print() returns the text object?
No, but you can use variables as arguments to love.graphics.print():

Code: Select all

love.graphics.print(t, x, y)
Changing the value of any of these will change what or where it is printed the next frame.
Help us help you: attach a .love.
intensity
Prole
Posts: 8
Joined: Wed Sep 29, 2010 8:26 pm

Re: Text

Post by intensity »

So if I wanted to make a changing text on screen, what should I use?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Text

Post by Robin »

Help us help you: attach a .love.
intensity
Prole
Posts: 8
Joined: Wed Sep 29, 2010 8:26 pm

Re: Text

Post by intensity »

All it is is changing the value of a variable called text... does text actually represent something in the renderer?
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: Text

Post by TechnoCat »

intensity wrote:All it is is changing the value of a variable called text... does text actually represent something in the renderer?
It does if you pass 'text' to love.graphics.draw()
I have a feeling love callbacks is what you actually need to read though. Hopefully learning about the LOVE callbacks will help you understand what is going on.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Text

Post by Robin »

TechnoCat wrote:
intensity wrote:All it is is changing the value of a variable called text... does text actually represent something in the renderer?
It does if you pass 'text' to love.graphics.print()
FIFY.
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 2 guests