Camera

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.
User avatar
yetneverdone
Party member
Posts: 446
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: Camera

Post by yetneverdone »

KyleFlores1014 wrote: Thu Jun 01, 2017 6:08 am I rewrote my code but now i cant add the on screen controls like before. because of the local ={}
Please send the code so that i can see whats the error
KyleFlores1014
Citizen
Posts: 73
Joined: Thu May 25, 2017 1:43 pm

Re: Camera

Post by KyleFlores1014 »

nevermind that error i fixed it but i made 2 fonts but when i try to make a new one it makes an error
User avatar
yetneverdone
Party member
Posts: 446
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: Camera

Post by yetneverdone »

KyleFlores1014 wrote: Fri Jun 02, 2017 10:20 am nevermind that error i fixed it but i made 2 fonts but when i try to make a new one it makes an error
Use fontName = love.graphics.newFont("pathToFont")
KyleFlores1014
Citizen
Posts: 73
Joined: Thu May 25, 2017 1:43 pm

Re: Camera

Post by KyleFlores1014 »

Thats the code i use but when I apply it using love.graphics.setFont(font) it makes an error but i already made 2 fonts the same way
User avatar
yetneverdone
Party member
Posts: 446
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: Camera

Post by yetneverdone »

KyleFlores1014 wrote: Fri Jun 02, 2017 2:09 pm Thats the code i use but when I apply it using love.graphics.setFont(font) it makes an error but i already made 2 fonts the same way
Always post the error you get. We can't guess whats the problem.
KyleFlores1014
Citizen
Posts: 73
Joined: Thu May 25, 2017 1:43 pm

Re: Camera

Post by KyleFlores1014 »

game.love
(505.34 KiB) Downloaded 178 times
Here is my code sorry if i didnt implement the switch function i dont get it
User avatar
yetneverdone
Party member
Posts: 446
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: Camera

Post by yetneverdone »

KyleFlores1014 wrote: Sat Jun 03, 2017 5:20 am game.love Here is my code sorry if i didnt implement the switch function i dont get it
As ive commented and explained in the template, the switch function is necessary. Because love.load is only run once, so if you change your gamestate, that new gamestate's load function will not be called. Therefore, you will get a lot of errors.

I will check your code later
KyleFlores1014
Citizen
Posts: 73
Joined: Thu May 25, 2017 1:43 pm

Re: Camera

Post by KyleFlores1014 »

Oh ok but the switch state, state = newState its gonna switch the state but wont that cause an error?
User avatar
yetneverdone
Party member
Posts: 446
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: Camera

Post by yetneverdone »

Ofcourse not, thats why before we actually switch to the new state, we call the current state's exit function (useful for a lot of stuffs, but if you don't need it, just let it be). Then switch the state, then call the new state's load function
KyleFlores1014
Citizen
Posts: 73
Joined: Thu May 25, 2017 1:43 pm

Re: Camera

Post by KyleFlores1014 »

game.love
(505.4 KiB) Downloaded 175 times
here is the code i already wrote the switch function but it still makes an error because of the font when you click about
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 93 guests