Search found 2133 matches

by pgimeno
Tue Jun 02, 2020 3:59 pm
Forum: Support and Development
Topic: Overlay
Replies: 8
Views: 312

Re: Overlay

OK, so I assume that the black and white image is a mask, the blue image is the background, and the red image is the one you want to draw over the background using the mask. This works for me: local bg = love.graphics.newImage('mountain-and-lake-landscape-800x600.jpg') local fg = love.graphics.newIm...
by pgimeno
Mon Jun 01, 2020 3:29 pm
Forum: Libraries and Tools
Topic: Simple Tiled Implementation - STI v1.2.3.0
Replies: 823
Views: 224862

Re: Simple Tiled Implementation - STI v1.2.3.0

print(#map.layers) If you use the above code, you can see how many layers you have, and change that 8 to 1 higher than what the print offers. Unfortunately that isn't guaranteed to work. The only method that works is ipairs. For example: local t = {1, 2, 3, 4, [6]=6} local n for i in ipairs(t) do n...
by pgimeno
Mon Jun 01, 2020 2:51 pm
Forum: Support and Development
Topic: Performance: should changing from if conditions to calling different functions be preferred?
Replies: 2
Views: 92

Re: Performance: should changing from if conditions to calling different functions be preferred?

I do believe that premature optimization on certain areas is the right thing to do, but you need some common sense for when to apply it. You don't need it for something that runs only once per frame.
by pgimeno
Mon Jun 01, 2020 10:08 am
Forum: Support and Development
Topic: Overlay
Replies: 8
Views: 312

Re: Overlay

If I understood what you're after I would be able to give you better advice. For colours, white (or full intensity of a given component) counts as 1.0, black counts as 0.0; for alpha, fully opaque counts as 1.0 and transparent as 0.0. That's the value that gets multiplied by the given component. Thi...
by pgimeno
Sun May 31, 2020 12:11 am
Forum: Support and Development
Topic: Overlay
Replies: 8
Views: 312

Re: Overlay

I'm not sure I'm understanding, but doesn't "multiply", "premultiplied" do this?
by pgimeno
Sat May 30, 2020 9:54 am
Forum: Support and Development
Topic: Code/game examples
Replies: 2
Views: 144

Re: Code/game examples

See also this subforum: https://love2d.org/forums/viewforum.php?f=14 in which several users post games. The advantage of the latter is that the games in the last threads are usually for the latest version of Löve.
by pgimeno
Fri May 29, 2020 7:32 pm
Forum: Support and Development
Topic: Attempt to perform arithmetic on "color" a nil value.
Replies: 4
Views: 135

Re: Attempt to perform arithmetic on "color" a nil value.

lushfoliage wrote:
Fri May 29, 2020 7:00 pm
Ahaha...turns out in some functions I had brick:render() instead of Brick:render(),
That should be the correct thing to have. You don't call an instance method on a class (Brick), you call it on the instances (brick). That's the whole point of the self parameter and the colon syntax.
by pgimeno
Fri May 29, 2020 10:12 am
Forum: Games and Creations
Topic: I have a problem with lag
Replies: 7
Views: 208

Re: I have a problem with lag

And please use the support forum to post questions!
by pgimeno
Fri May 29, 2020 10:08 am
Forum: Support and Development
Topic: Two dimensional love.math.noise with big values
Replies: 2
Views: 140

Re: Two dimensional love.math.noise with big values

Hello, welcome to the forums. Quite unfortunately, Löve is using single precision to generate noise, which intrinsically has that limitation on big values. Here's a representation of the range 1999999.5 to 2000000.5 in both dimensions, showing the loss of precision in the coordinates (it gets worse ...
by pgimeno
Thu May 28, 2020 8:57 pm
Forum: General
Topic: Optikon: A WYSIWYG Level Designer for LÖVE
Replies: 21
Views: 3136

Re: Optikon: A WYSIWYG Level Designer for LÖVE

Is it fair to say that it would be better to have a clearer separation between the generated map and the engine necessary to load it? Kind of like the file that Tiled generates, on one hand, and the library that loads them (plus a simple program to use the library to represent it, if you wish), on t...