Search found 2790 matches

by pgimeno
Mon Sep 27, 2021 10:18 am
Forum: General
Topic: love.timer.sleep resolution test
Replies: 5
Views: 116

Re: love.timer.sleep resolution test

My screen looks pretty much like your snapshot, Linux included, except instead of 10.2 I get 10.1, and the font is less blurred. I get a boring .1 everywhere. Debian Stretch (9.6) system.
by pgimeno
Sun Sep 26, 2021 11:02 pm
Forum: Support and Development
Topic: How to set volume of sfx and music differently?
Replies: 8
Views: 141

Re: How to set volume of sfx and music differently?

Any example with the love.audio. Unfortunately I'm confused *sigh* and sleepy. So I only use one setVolume that works for both? But the music is really louder than the sfx by default... OK, if the music is the louder one, consider something like this: local MUSIC_VOLUME = 0.5 -- play with this valu...
by pgimeno
Sun Sep 26, 2021 10:50 pm
Forum: Support and Development
Topic: How to set volume of sfx and music differently?
Replies: 8
Views: 141

Re: How to set volume of sfx and music differently?

I'd adjust the relative volumes of effects and music so that one is set to 1.0; once satisfied, if everything is too loud you can use love.audio.setVolume to lower it, and offer a volume option to the player.

As for distances, try with Source:setRolloff and/or Source:setAttenuationDistances.
by pgimeno
Sun Sep 26, 2021 10:35 pm
Forum: Support and Development
Topic: How to set volume of sfx and music differently?
Replies: 8
Views: 141

Re: How to set volume of sfx and music differently?

love.audio.setVolume is applied at the end; it's a master volume control, as if your computer was connected to an amplifier and you turned the knob. If you turn the knob to zero, there's no sound anymore no matter the individual volumes of the samples. Each sound has its own volume control. If you w...
by pgimeno
Sun Sep 26, 2021 1:11 pm
Forum: Support and Development
Topic: Building with my own LuaJIT
Replies: 3
Views: 130

Re: Building with my own LuaJIT

Have you tried to build the development version?
by pgimeno
Sun Sep 26, 2021 11:06 am
Forum: Support and Development
Topic: attempt to index out of range sample
Replies: 8
Views: 241

Re: attempt to index out of range sample

Okay, the problem was using a 1-based index to access the samples. This works: local NormalizedI = (I-1)/NewDuration But as I said, it's easier at this point to loop with a zero-based index instead of subtracting 1 twice: for I=0,NewDuration-1 do The same problem is in RandomChopping. Looping from 0...
by pgimeno
Sun Sep 26, 2021 2:13 am
Forum: Support and Development
Topic: attempt to index out of range sample
Replies: 8
Views: 241

Re: attempt to index out of range sample

Yeah I was pretty off with that comment, sorry. If you can provide a runnable example maybe we can help better.
by pgimeno
Sat Sep 25, 2021 10:50 am
Forum: Support and Development
Topic: can't pass table to function
Replies: 4
Views: 152

Re: can't pass table to function

Welcome to the forums. There isn't enough information in the code snippets that you have posted. However, it is clear that your collide function does not use the argument, and that is bad. I think that instead of pup.x, pup.y... it should be using target.x, target.y... Also, next time please copy an...
by pgimeno
Sat Sep 25, 2021 10:39 am
Forum: Support and Development
Topic: attempt to index out of range sample
Replies: 8
Views: 241

Re: attempt to index out of range sample

I think the problem is with NewDuration. First of all, due to the implementation of math.random in LuaJIT, this line will either give a value of 0.5 or 1.5 (which one of both is random): local Speed = math.random(0.5,2) I think you want this instead: local Speed = math.random()*1.5 + 0.5 Then there'...
by pgimeno
Thu Sep 23, 2021 10:29 pm
Forum: Support and Development
Topic: Other ways than shaders for transparent color?
Replies: 5
Views: 301

Re: Other ways than shaders for transparent color?

Edit: Ninja'd by MrFariator but I think this post may still be useful. A shader will work quite well; but if you really must avoid it, one alternative is a stencil. local totalTime = 2 local objects = {} local speed = 600 local effect = false local canvas = love.graphics.newCanvas() local T = 0 loca...