Search found 1179 matches

by pgimeno
Sat Aug 18, 2018 12:12 am
Forum: General
Topic: Fill Patterns?
Replies: 1
Views: 38

Re: Fill Patterns?

Hi, welcome to the forums. I'm not sure if you mean something like what love.graphics.stencil (and its companion love.graphics.setStencilTest ) does. With these functions, you draw a mask onto a special surface, the stencil, and then set the stencil test so that all drawing operations will only touc...
by pgimeno
Fri Aug 17, 2018 5:12 pm
Forum: Support and Development
Topic: Shrinking numbers
Replies: 2
Views: 59

Re: Shrinking numbers

You're asking too much from floating-point precision. What you seem to be trying to achieve is typically done with a model matrix (or quaternion) that gets renormalized every while, to avoid this kind of drift. In your case the drift is always towards shrinking, but it can be either way. The idea is...
by pgimeno
Wed Aug 15, 2018 9:40 am
Forum: Support and Development
Topic: Micro lag/Skipping; I'm at a loss.
Replies: 4
Views: 165

Re: Micro lag/Skipping; I'm at a loss.

Yes I did. I don't know how many strings you have to concatenate to make string.format be faster, but it's going to be quite some. local a = "12345678" local b = "12345679" local c local gettime = os.clock --local gettime = require'socket'.gettime local start = gettime() for i = 1, 10000000 do c = (...
by pgimeno
Tue Aug 14, 2018 10:44 pm
Forum: Support and Development
Topic: [SOLVED] Handling error exceptions for assert(loadstring(str))() ?
Replies: 8
Views: 144

Re: [SOLVED] Handling error exceptions for assert(loadstring(str))() ?

You're welcome. Now that I think about it, I've realized that that's only half-baked, as it only deals with one return value, without even distinguishing nil from false or from no value. In the console of Lua and LuaJIT that works perfectly: > return nil nil > return > return false false > return 1,...
by pgimeno
Tue Aug 14, 2018 9:59 pm
Forum: Support and Development
Topic: [SOLVED] Handling error exceptions for assert(loadstring(str))() ?
Replies: 8
Views: 144

Re: [SOLVED] Handling error exceptions for assert(loadstring(str))() ?

Yeah, you missed returning the value for pcall: pcall(function() return assert(...

Edit: also, you missed the second argument, now that I look closer. The first argument is always a boolean. That was probably the problem.
by pgimeno
Tue Aug 14, 2018 9:48 pm
Forum: Support and Development
Topic: [SOLVED] Handling error exceptions for assert(loadstring(str))() ?
Replies: 8
Views: 144

Re: Handling error exceptions for assert(loadstring(str))() ?

You probably don't want to use assert , as that would need more layers of error handling. Try this: local fn, err = loadstring(console.command) if not fn then console:print(err) else local ok, result = pcall(fn) if not ok then -- There was an error, so result is an error. Print it out. console:print...
by pgimeno
Tue Aug 14, 2018 7:44 pm
Forum: Support and Development
Topic: Micro lag/Skipping; I'm at a loss.
Replies: 4
Views: 165

Re: Micro lag/Skipping; I'm at a loss.

Hi Cluly, welcome to the forums! I'm not sure what kind of lag we're talking about here. I didn't notice any micro-lag in the above video. If anything, the scrolling demo (which is at 0:23:11, not at 0:0:24) skips one pixel too much once in a while, which is pretty much the opposite of lag, and is a...
by pgimeno
Tue Aug 14, 2018 6:34 pm
Forum: Support and Development
Topic: [SOLVED] `pcall(...)` inside `Canvas:renderTo(...)`
Replies: 4
Views: 303

Re: [SOLVED] `pcall(...)` inside `Canvas:renderTo(...)`

love.graphics.present() is called by the default love.run. If a canvas is active when love.draw finishes, you'll get that error because that's when love.graphics.present is called. That's the 'present' that the error message refers to.
by pgimeno
Sat Aug 11, 2018 10:33 am
Forum: Support and Development
Topic: Black Screen when Dropping .love on Love2D
Replies: 7
Views: 198

Re: Black Screen when Dropping .love on Love2D

Looks like the rectangle did work? Maybe look for newer drivers, then.