Search found 3556 matches

by pgimeno
Tue Mar 12, 2024 2:03 pm
Forum: General
Topic: Gradients (gradient as fill)
Replies: 10
Views: 3672

Re: Gradients (gradient as fill)

I make gradients with a 2x1 image and a quad. local gradientData = love.image.newImageData(2, 1, 'rgba8', '\255\000\000' .. '\255' .. '\000\255\000' .. '\255') local gradient = love.graphics.newImage(gradientData) gradient:setFilter('linear', 'linear') local gradientQuad = love.graphics.newQuad(0.5,...
by pgimeno
Sat Mar 09, 2024 11:46 pm
Forum: Support and Development
Topic: Method doesn't see self variable when called by other method (hump.class)
Replies: 8
Views: 2021

Re: Method doesn't see self variable when called by other method (hump.class)

This should be slightly faster than using that metatable mechanism, since it doesn't need the double-lookup (looking up the key on the "instance" table, not finding it, then looking it up on the __index table). In fact I'm thinking of going with this on some speed-critical code. Apparentl...
by pgimeno
Thu Feb 29, 2024 11:15 am
Forum: Libraries and Tools
Topic: Native open/save dialogs for Windows
Replies: 2
Views: 2582

Re: Native open/save dialogs for Windows

Note that Lua's strings are always in bytes, so if you try to print() something to the console and that something has UTF-8 encoding, it will look strange, but that's just the console interpreting it as ASCII: preview02.png I believe you can fix that with 'chcp 65001'. Note also that you need to se...
by pgimeno
Mon Feb 19, 2024 7:13 pm
Forum: General
Topic: I can't get rid of the blurred text
Replies: 9
Views: 2419

Re: I can't get rid of the blurred text

Looks sharp to me as well, though a bit small. I used this font: https://github.com/rsms/inter/releases/download/v4.0/Inter-4.0.zip (after unzipping, it's the one in extras/ttf/Inter-Regular.ttf) Are you sure that's all the code? Aren't you using love.graphics.scale or anything? I used this (copied ...
by pgimeno
Wed Feb 14, 2024 4:58 pm
Forum: Support and Development
Topic: Http requests
Replies: 7
Views: 1013

Re: Http requests

It sounds like a wrong DLL. Either wrong bits (32 vs 64) or this ssl.dll is not the one expected by LuaSec.
by pgimeno
Tue Feb 13, 2024 3:31 pm
Forum: Libraries and Tools
Topic: Maze Thread
Replies: 50
Views: 43965

Re: Maze Thread

I recently implemented Kruskal's algorhtm. Conceptually It's one of the simplest I found; however, the mazes it generates have many short blind alleys, as it happens with any other algorithm which generates a uniformly distributed spanning tree (such as Aldous-Broder or Wilson's algorithms). This ti...
by pgimeno
Tue Feb 13, 2024 2:42 pm
Forum: General
Topic: Code Doodles!
Replies: 197
Views: 275513

Re: Code Doodles!

I was toying around with mazes the other day and found the recursive backtracker to be pretty easy to implement and generally nice to look at. It guarantees a maze where every spot is filled in and all spots are on a single network. There's a thread expressly dedicated to mazes: https://love2d.org/...
by pgimeno
Mon Feb 12, 2024 2:54 pm
Forum: General
Topic: Optimisation of drawing 3d
Replies: 1
Views: 915

Re: Optimisation of drawing 3d

I can only reply to this question: what calculations should i do in update, what is better to keep in draw, and is there any differences at all? I'm not fully sure what you mean. love.update and love.draw are executed one after the other, in that order. There's no difference other than the fact that...
by pgimeno
Sun Jan 21, 2024 6:12 pm
Forum: Support and Development
Topic: Z-sections with T-crossings
Replies: 4
Views: 1499

Re: Z-sections with T-crossings

The idea is quite interesting, but I'm not convinced that all possible rectangles are solvable. It's easy to come up with a dead end. For example, I took your fourth example and after the second stage, I placed the next Z on the left differently, and then one more on the right, and came up with this...