Search found 947 matches

by grump
Wed Aug 04, 2021 9:43 am
Forum: General
Topic: print prints floating point with a comma
Replies: 2
Views: 4138

Re: print prints floating point with a comma

What does

Code: Select all

os.setlocale(nil)
return?

If it's something other than "C", try

Code: Select all

os.setlocale("C")
to switch to the standard C locale. This should fix the issue.
by grump
Wed Jul 28, 2021 10:18 pm
Forum: Support and Development
Topic: online single player
Replies: 12
Views: 6593

Re: online single player

The basic concepts would be the same in both cases. You just have one player instead of many players. You may be overestimating the ingenuity of your work if you're convinced that people will be so eager to steal it, even though you can't even figure out how to do it in the first place. You're in wa...
by grump
Mon Jul 26, 2021 3:19 pm
Forum: Support and Development
Topic: Strange alpha blending when transforming
Replies: 6
Views: 4888

Re: Strange alpha blending when transforming

It made me wondering though, couldnt LOVE just make an exception to its linear filter for 0.0 alpha pixels to blend with neighbors only by alpha channel and not the colors? That's not LÖVE's linear filter, that's how the blendmode formula in the hardware works. You can use premultiplied data instea...
by grump
Mon Jul 26, 2021 2:17 pm
Forum: Support and Development
Topic: Strange alpha blending when transforming
Replies: 6
Views: 4888

Re: Strange alpha blending when transforming

programmatically you'd have to do the equivalent of this: Or just convert to premultiplied alpha: local img = love.image.newImageData('tex.png') img:mapPixel(function(x, y, r, g, b, a) return r * a, g * a, b * a, a end) -- but you have to remember to set the correct blend mode: love.graphics.setBle...
by grump
Mon Jul 26, 2021 1:00 pm
Forum: Support and Development
Topic: Strange alpha blending when transforming
Replies: 6
Views: 4888

Re: Strange alpha blending when transforming

That's because the transparent pixels have a color, too - they are probably white in your texture, and filtering causes that white to bleed into the purple. Make them the same color as the interior and the issue will disappear.
by grump
Sat Jul 17, 2021 10:12 pm
Forum: Libraries and Tools
Topic: Love Example Navigator
Replies: 7
Views: 9335

Re: Love Example Navigator

I'm not asking for help on how to make it work, I'm giving suggestions on how to make it better. If there's nothing to run, don't show a run button. A basic UX principle.
by grump
Sat Jul 17, 2021 9:55 pm
Forum: Libraries and Tools
Topic: Love Example Navigator
Replies: 7
Views: 9335

Re: Love Example Navigator

When I select the one example folder in this and click run, nothing happens. Maybe show only buttons that actually do something? The example code: -- Load an image and display it local image function love.load() image = love.graphics.newImage("assets/chest.png") end function love.draw() lo...
by grump
Thu Jul 15, 2021 7:53 pm
Forum: Games and Creations
Topic: Grumpy NES emulator
Replies: 23
Views: 34508

Re: Grumpy NES emulator

Yeah, it's not really in a finished state that would be fit for release. The ROM loader alone is a bad hack that restarts LÖVE when you drop a file, because the JIT shits the bed really badly if you run different ROMs in the same session. Never even tested it on Windows or MacOS. I had to "figh...
by grump
Wed Jul 14, 2021 2:41 pm
Forum: Support and Development
Topic: require internal libraries
Replies: 5
Views: 5088

Re: require internal libraries

A well written library should account for that and allow to be required from any path. I personally would steer clear from libs that don't do this because it's a red flag, and you're probably dealing with bad code that will have more problems down the line. You can modify package.path (pure Lua) or ...
by grump
Mon Jul 12, 2021 5:08 pm
Forum: Support and Development
Topic: [Solved] Lua constant
Replies: 6
Views: 7577

Re: Lua constant

For integer constants you can do this in LuaJIT: local ffi = require('ffi') local MyEnum = ffi.typeof([[ struct { enum { CONST_A = 23, CONST_B = 1337, CONST_C = 42, }; } ]]) print(MyEnum.CONST_B) -- 1337 MyEnum.CONST_A = 1 -- error: attempt to write to constant location This works for integers only ...