Loveframes setState black screen

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
Coder567
Prole
Posts: 42
Joined: Sun Apr 07, 2019 12:32 pm

Loveframes setState black screen

Post by Coder567 »

Hi
Does anyone know what's wrong when I use loveframes setState command to switch between frames and it works first properly but then one of my frames shows nothing but black screen?

I do this:

Code: Select all

loveframes.SetState("mainMenu") -- works
loveframes.SetState("stats") -- works
loveframes.SetState("mainMenu") -- works
loveframes.SetState("stats") -- Black screen! Where did my frame go?
thanks!
User avatar
Baggef
Prole
Posts: 20
Joined: Fri Aug 23, 2019 7:30 pm
Location: USA
Contact:

Re: Loveframes setState black screen

Post by Baggef »

Could you attach a .love file? Just zip your game, and change the ending from .zip to .love. It will make it easier for us to help you
gaeem defelpmint is maiy pashin
Itch: Freakman
Coder567
Prole
Posts: 42
Joined: Sun Apr 07, 2019 12:32 pm

Re: Loveframes setState black screen

Post by Coder567 »

I'd prefer not to give away the source code. It would help me a lot if someone who has used the SetState function could tell if they ever had such problem?
Coder567
Prole
Posts: 42
Joined: Sun Apr 07, 2019 12:32 pm

Re: Loveframes setState black screen

Post by Coder567 »

Looks like I found the problem.
When trying to change the state in frame:OnClose I get the black screen.
code:

Code: Select all

frame.OnClose = function(object)
  -- state change code here
end
But if I create a button for changing the frame then everything works
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest