Page 71 of 91

Re: "Questions that don't deserve their own thread" thread

Posted: Wed Oct 05, 2016 2:05 pm
by MrFariator
Do you have vsync enabled in your conf.lua by any chance? I'd update video drivers just to be sure, too. Had some odd behavior on my main desktop when I was running old/outdated drivers, but only while in windowed mode (Windows 7).

I am using an old 2008 Macbook (Intel Core 2 Duo, NVIDIA GeForce 9400M) for deving on the go and it works perfectly fine, so even a toaster shouldn't have issues with love.
ingodet wrote:The text might be 1 or 2 frames behind the cursor.
I think 1-2 frames shouldn't be too far off from acceptable parameters; particularly if you disable the OS mouse inside the love window (love.mouse.setVisible(false)) and draw your own mouse graphic.

Re: "Questions that don't deserve their own thread" thread

Posted: Wed Oct 05, 2016 4:03 pm
by pgimeno
It seems you have vsync enabled and that it's 1 frame behind. Some discussion here: https://www.love2d.org/forums/viewtopic ... 09#p195509

Edit: and an explanation on why it's happening is here: https://www.love2d.org/forums/viewtopic ... 02#p195502

Re: "Questions that don't deserve their own thread" thread

Posted: Thu Oct 06, 2016 9:12 am
by ingodet
pgimeno wrote:It seems you have vsync enabled and that it's 1 frame behind. Some discussion here: https://www.love2d.org/forums/viewtopic ... 09#p195509

Edit: and an explanation on why it's happening is here: https://www.love2d.org/forums/viewtopic ... 02#p195502
Wonderful! Works like a charm :awesome:

Re: "Questions that don't deserve their own thread" thread

Posted: Fri Oct 07, 2016 10:44 am
by ZodaInk

Code: Select all

if pcall(love.keyboard.getScancodeFromKey("incorrect KeyConstant")) then
  -- do stuff
end
This code will show the error message "Invalid key constant: incorrect KeyConstant".
Is this intended behavior? I expected pcall to prevent the error message.

Re: "Questions that don't deserve their own thread" thread

Posted: Fri Oct 07, 2016 10:56 am
by bartbes
Yes, because you're calling pcall on the result of getScancodeFromKey. What you want to do is

Code: Select all

pcall(love.keyboard.getScancodeFromKey, "incorrect KeyConstant")
To clarify, pcall is not syntax, it doesn't magically change the way lua reads code, it's a function.

Re: "Questions that don't deserve their own thread" thread

Posted: Fri Oct 07, 2016 10:59 am
by ZodaInk
Ah, right... I forgot pcall works that way.

Re: "Questions that don't deserve their own thread" thread

Posted: Fri Oct 07, 2016 2:47 pm
by Zireael
So what about games using LoveFrames? Are there any out there?

Re: "Questions that don't deserve their own thread" thread

Posted: Sat Oct 08, 2016 10:20 am
by steVeRoll
I recently discovered about pixel shaders, and their use in love2d. So I was wondering - Is there a way to apply a shader to the whole screen? The only way I can think of is drawing everything into an ImageData object and applying a shader to that, but there's probably a better way.
I'm sorry if this question doesn't make sense - I'm new to love2d and lua in general and I have no idea how it works.

Re: "Questions that don't deserve their own thread" thread

Posted: Sat Oct 08, 2016 11:35 am
by Nixola
You should draw everything to a [wiki]Canvas[/wiki] and then the canvas to the screen.

Re: "Questions that don't deserve their own thread" thread

Posted: Sat Oct 08, 2016 3:02 pm
by Jack Dandy
Hey, I have a question about the Hump.timer's "every" function.

Let's say I have this piece of code:

Code: Select all

if key == 's' then
    Timer_enemyturn:every(1, gamefuncs.activateAI())
  end
But, when I push 's', it only activates the enemy's AI once. How come? I thought it should make the enemy's AI activate every second.

I even checked it, and when I replaced the "activateAI" function with a simple print-to-console function, it only called it once.