Search found 2557 matches
- Fri Apr 16, 2021 4:38 pm
- Forum: Support and Development
- Topic: Why doesn't Font.getHeight() work the same as Font.getWidth()?
- Replies: 1
- Views: 18
Re: Why doesn't Font.getHeight() work the same as Font.getWidth()?
If you use love.graphics.print, the total height is the number of lines (number of \n + 1) multiplied by Font:getHeight(). If you use love.graphics.printf, you can get the number of final lines by taking the number of elements present in the second return value of Font:getWrap . Multiplying that by ...
- Fri Apr 16, 2021 11:07 am
- Forum: Support and Development
- Topic: Coordinates for lines vs points (and pixel grid alignment for points)
- Replies: 4
- Views: 159
Re: Coordinates for lines vs points (and pixel grid alignment for points)
Well, I was wrong, but not by much. As it turns out, the rounding depends on whether the line is horizontal or vertical, and there are good reasons for that. First, let's talk about filled rectangles. Rectangles don't have the same problems as lines, because they have an edge. You place the top left...
- Wed Apr 14, 2021 4:29 pm
- Forum: Support and Development
- Topic: Coordinates for lines vs points (and pixel grid alignment for points)
- Replies: 4
- Views: 159
Re: Coordinates for lines vs points (and pixel grid alignment for points)
I see no inconsistency in behaviour. There seems to be some inconsistency in the rounding performed by your graphics card driver when drawing points, which I believe is an OpenGL native operation, while love.graphics.line is polygon-based, so the rounding for lines is performed on the Löve side. The...
- Tue Apr 13, 2021 11:31 am
- Forum: Support and Development
- Topic: Coordinates for lines vs points (and pixel grid alignment for points)
- Replies: 4
- Views: 159
Re: Coordinates for lines vs points (and pixel grid alignment for points)
It's just natural that coordinates work that way. The edges of the pixels are at integral positions, the centres are at a distance of 0.5 from either edge. It's the same for lines and rectangles; try drawing horizontal or vertical lines, or rectangles in line mode, at integer coordinates with love.g...
- Tue Apr 13, 2021 2:31 am
- Forum: Support and Development
- Topic: Multidimentional arrays/Tables
- Replies: 14
- Views: 409
Re: Multidimentional arrays/Tables
It depends, even in LuaJIT. Undefined is the right word.
Code: Select all
$ luajit -e 'print(#{1,2,nil,4})'
4
- Mon Apr 12, 2021 9:59 am
- Forum: Support and Development
- Topic: How much C++ really improves Love?
- Replies: 4
- Views: 194
Re: How much C++ really improves Love?
There are modules wrote in C/C++ that can be loaded simply by require(), since they implement functions that can be exposed directly to Lua. I tried that and it's pretty easy, but I can't compile the code of the library into a dll so that Love can require it. So my question is: Is there any guideli...
- Mon Apr 12, 2021 1:37 am
- Forum: Support and Development
- Topic: How much C++ really improves Love?
- Replies: 4
- Views: 194
Re: How much C++ really improves Love?
Assuming I have not been rickrolled... :D 1. Is it really worthy to write a module in C++, instead of Lua in the context of Love? If so, any good suggestions on how to actually do it? Hard to say whether it's worth or not. Probably not, at least from the perspective of the multi-platform compilation...
- Sun Apr 11, 2021 1:18 pm
- Forum: Support and Development
- Topic: If statement and Goto
- Replies: 28
- Views: 981
Re: If statement and Goto
Do you mean for debugging? You can add a 'name' field.darkfrei wrote: ↑Sun Apr 11, 2021 11:39 amHow I can understand which stete is enabled?pgimeno wrote: ↑Sun Apr 11, 2021 11:04 am I wrote about one way of dealing with states, starting here: https://love2d.org/forums/viewtopic.php ... 26#p194226
Take a look, see if that helps you wrap around your head around it.
- Sun Apr 11, 2021 11:04 am
- Forum: Support and Development
- Topic: If statement and Goto
- Replies: 28
- Views: 981
Re: If statement and Goto
I wrote about one way of dealing with states, starting here: https://love2d.org/forums/viewtopic.php ... 26#p194226
Take a look, see if that helps you wrap around your head around it.
Take a look, see if that helps you wrap around your head around it.
- Sat Apr 10, 2021 4:37 pm
- Forum: Games and Creations
- Topic: SnowFlakes
- Replies: 5
- Views: 300
Re: SnowFlakes
Brings memories of Track & Field, hehe. Nice. Level 14 might be the maximum humanly possible in a decent graphics card (I got there too; my spacebar is going to sue me for abuse), but by setting love.keyboard.setKeyRepeat(true) it can be shown that it's not the maximum level attainable. In my de...