Search found 251 matches

by RNavega
Sat Apr 27, 2024 5:57 am
Forum: General
Topic: Image format size pickle
Replies: 1
Views: 48

Re: Image format size pickle

There are compressed image formats that support transparency, scroll down to the Compressed Formats table: https://love2d.org/wiki/PixelFormat The DXT5 format (Microsoft DirectDraw Surface DXT5) seems the best match. ImageMagick seems to read and write those. Also, if you don't need one of the color...
by RNavega
Sat Apr 27, 2024 5:38 am
Forum: Support and Development
Topic: [SOLVED] Variable Jump Height
Replies: 5
Views: 192

Re: [SOLVED] Variable Jump Height

I know that this was marked as solved, but I wanted to investigate it further. When playing Super Mario World on some SNES emulator, the jump mechanic seems to let the player do either short jumps that reach 3 tiles high, or long jumps that reach 4 tiles high, and if the player releases the jump key...
by RNavega
Mon Apr 22, 2024 11:09 pm
Forum: Support and Development
Topic: Create multiple squares upon keyclicks
Replies: 3
Views: 189

Re: Create multiple squares upon keyclicks

Nice. You can still remove the use of mainCanvas (that is, setCanvas(mainCanvas), setCanvas(), and draw(mainCanvas)), so having no canvases at all, and draw directly to the screen. You aren't doing anything different with the contents of the canvas except passing them to the screen already, so it's ...
by RNavega
Mon Apr 22, 2024 1:01 am
Forum: Support and Development
Topic: Benchmark - put every function inside a object or inside a helper object
Replies: 4
Views: 1343

Re: Benchmark - put every function inside a object or inside a helper object

object:anotherFuction1() helper:anotherFuction1(object) As I understand it, the second case is right in being more expensive, as it handles more parameters. In both cases you have a table key query ("anotherFuction1"), but the parameters in the first case are (self,), and in the second ca...
by RNavega
Sun Apr 21, 2024 6:04 pm
Forum: Support and Development
Topic: Create multiple squares upon keyclicks
Replies: 3
Views: 189

Re: Create multiple squares upon keyclicks

Hi Giuliano, welcome. Here are my impressions: - You don't need to reference the global table _G every time. This is already done for you when you use a name that was declared without the 'local' qualifier. It's a great practice to use "local" for everything, even things declared in the to...
by RNavega
Fri Apr 19, 2024 12:30 am
Forum: Libraries and Tools
Topic: Rasterizing polygons into images
Replies: 5
Views: 1200

Re: Rasterizing polygons into images

Wow, thanks guys! I've tried to make the d-string parser, but it was always bad, there are too much variations how you can write the same vectors. Ah, mine is very simple and would probably fail too with some SVGs out in the wild. By the way, I was fascinated by your work on parabolas. I was looking...
by RNavega
Tue Apr 16, 2024 1:44 pm
Forum: Libraries and Tools
Topic: Rasterizing polygons into images
Replies: 5
Views: 1200

Rasterizing polygons into images

This is an example script of rasterizing a polygon into a grayscale image (R8 format). So, starting from SVG data, you generate an Image object from it then draw that Image as needed. Depending on the shape and its size, it's a bit lighter to have it described as SVG data than as a PNG file in your ...
by RNavega
Fri Apr 05, 2024 11:04 am
Forum: Support and Development
Topic: Avoid table overhead by using Data when creating a mesh
Replies: 6
Views: 525

Re: Avoid table overhead by using Data when creating a mesh

Wow, you're right. Thanks for the correction. I don't know why I said all of that, when a few days ago I had read the Löve source code and seen how it differentiates the possible uniform types (int, float etc), and used int in a shader myself... The OpenGL wiki does list more types that should be av...
by RNavega
Thu Apr 04, 2024 9:12 pm
Forum: Support and Development
Topic: 2D Array
Replies: 6
Views: 537

Re: 2D Array

Code: Select all

function FallingSand:update(dt)
	print(FallingSand:withinCols(5))
end
Try self:withinCols(5) so the sugar becomes FallingSand.withinCols(self, 5).

The colon syntax is explained in here (the entire PIL e-book is useful btw): https://www.lua.org/pil/16.html
by RNavega
Thu Apr 04, 2024 10:18 am
Forum: Support and Development
Topic: Avoid table overhead by using Data when creating a mesh
Replies: 6
Views: 525

Re: Avoid table overhead by using Data when creating a mesh

Unorm16: according to this answer , on older OpenGL versions all data types are mapped to floats. So in your case, it would be a vec2 indeed. In the OpenGL wiki it says that there are other GLSL data types like int, uint, ivecn, uvecn and dvecn, so I think that after some GLSL version those new typ...