Question 1
I have a little info box in which various things print information. The height of the box is variable... the width is not, so I use love.graphics.printf's wrapping feature.
So, question: how can I figure out the total height of the box if I already know what text is going to be shown, but not how it's going to be wrapped? Is there a way to know how many lines printf decided (or will decide) to use when wrapping?
If not, how do people usually approach this problem?
Question 2
While using threads I noticed that I cannot call any love functions at all, besides a few from love.thread. The wiki says that love.graphics should not work, but that implies that other modules (love.timer, love filesystem, etc) should... yet nothing works. Is this just a linux bug, or a new feature of Love 0.8.0?
Questions on printf and love.thread [solved]
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Whyte Vuh'uni
- Prole
- Posts: 7
- Joined: Sun May 06, 2012 1:52 pm
Questions on printf and love.thread [solved]
Last edited by Whyte Vuh'uni on Thu May 10, 2012 2:08 pm, edited 1 time in total.
Re: Questions on printf and love.thread
1. There's Font:getWrap and Font:getHeight. I hope they work as advertised.
2. I added some info to the wiki that a Thread only loads love.thread automatically. You have to load the other modules with require("love.filesystem") and so on.
2. I added some info to the wiki that a Thread only loads love.thread automatically. You have to load the other modules with require("love.filesystem") and so on.
Shallow indentations.
- Whyte Vuh'uni
- Prole
- Posts: 7
- Joined: Sun May 06, 2012 1:52 pm
Re: Questions on printf and love.thread
Oh, wow... that's perfect. I was apparently searching in the wrong place (i.e. love.font, which has nothing). Many thanks!
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Questions on printf and love.thread [solved]
I'm pretty sure that used to be documented...
Who is online
Users browsing this forum: Google [Bot], Semrush [Bot] and 5 guests