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 » Sat Oct 05, 2019 11:37 am

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: 18
Joined: Fri Aug 23, 2019 7:30 pm
Location: USA
Contact:

Re: Loveframes setState black screen

Post by Baggef » Sat Oct 05, 2019 11:01 pm

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
Twitter: baggefArt

Coder567
Prole
Posts: 42
Joined: Sun Apr 07, 2019 12:32 pm

Re: Loveframes setState black screen

Post by Coder567 » Sun Oct 06, 2019 7:54 am

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 » Mon Oct 07, 2019 7:24 am

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: No registered users and 12 guests