## Text

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

### Text

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?
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

### Re: Text

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

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

### Re: Text

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+.
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

### Re: Text

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

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

### Re: Text

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

### Re: Text

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

### Re: Text

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.
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

### Re: Text

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.

### Who is online

Users browsing this forum: No registered users and 10 guests