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

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Locked
MrFariator
Party member
Posts: 559
Joined: Wed Oct 05, 2016 11:53 am

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

Post 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.
User avatar
pgimeno
Party member
Posts: 3674
Joined: Sun Oct 18, 2015 2:58 pm

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

Post 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
ingodet
Prole
Posts: 3
Joined: Wed Oct 05, 2016 12:03 pm

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

Post 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:
User avatar
ZodaInk
Prole
Posts: 18
Joined: Thu Jan 08, 2015 5:18 am

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

Post 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.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post 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.
User avatar
ZodaInk
Prole
Posts: 18
Joined: Thu Jan 08, 2015 5:18 am

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

Post by ZodaInk »

Ah, right... I forgot pcall works that way.
Zireael
Party member
Posts: 139
Joined: Fri Sep 02, 2016 10:52 am

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

Post by Zireael »

So what about games using LoveFrames? Are there any out there?
User avatar
steVeRoll
Party member
Posts: 140
Joined: Sun Feb 14, 2016 1:13 pm

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

Post 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.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

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

Post by Nixola »

You should draw everything to a [wiki]Canvas[/wiki] and then the canvas to the screen.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
Jack Dandy
Prole
Posts: 49
Joined: Mon Sep 08, 2014 4:26 pm

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

Post 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.
Last edited by Jack Dandy on Sat Oct 08, 2016 3:24 pm, edited 1 time in total.
Locked

Who is online

Users browsing this forum: Ahrefs [Bot], Amazon [Bot], Google [Bot], Semrush [Bot] and 7 guests