Page 1 of 1

Graphics.setMode doesnt work!!

Posted: Tue Dec 26, 2017 9:43 am
by Neer
wiki page:Tutorial:Physics
I read this tutorial and copy the whole code,
but it doesnt work and warn:Error main.lua:33:attempt to call field'setMode'(a nil value)
help me~ better in chinese~ ;) ;)

Re: Graphics.setMode doesnt work!!

Posted: Wed Dec 27, 2017 12:58 pm
by steVeRoll
Welcome to the forums! We will be able to help you more if you post the line of code in which the error has happened, or maybe the entire code, even if you copied it. My only guess is that you replaced "window" with "graphics", or you are using an outdated version of love2d.

Re: Graphics.setMode doesnt work!!

Posted: Fri Dec 29, 2017 5:54 am
by Neer
steVeRoll wrote: Wed Dec 27, 2017 12:58 pm Welcome to the forums! We will be able to help you more if you post the line of code in which the error has happened, or maybe the entire code, even if you copied it. My only guess is that you replaced "window" with "graphics", or you are using an outdated version of love2d.
thx to reply!i upload the main.lua file,my love2d's version is 0.10.2,the latest,thx again!
either"window"or"graphics" doesn't work!
im not a native speaker fogive my poor english xD

Re: Graphics.setMode doesnt work!!

Posted: Fri Dec 29, 2017 6:15 am
by zorg
https://love2d.org/wiki/love.graphics.setMode
-> Removed in LÖVE 0.9.0; Moved to the love.window module as love.window.setMode.
https://love2d.org/wiki/love.window.setMode

Interestingly, your link to the physics tutorial on the wiki shows love.windows.setMode being used, and that should work.

Edit: Nice catch, slime!
To be fair, they did link the english version, so i kinda did not assume that.

Re: Graphics.setMode doesnt work!!

Posted: Fri Dec 29, 2017 2:55 pm
by slime
It looks like the chinese translation of the tutorial hasn't been updated since before 0.9.0 came out.

Re: Graphics.setMode doesnt work!!

Posted: Wed Jan 03, 2018 5:54 am
by Neer
zorg wrote: Fri Dec 29, 2017 6:15 am https://love2d.org/wiki/love.graphics.setMode
-> Removed in LÖVE 0.9.0; Moved to the love.window module as love.window.setMode.
https://love2d.org/wiki/love.window.setMode

Interestingly, your link to the physics tutorial on the wiki shows love.windows.setMode being used, and that should work.

Edit: Nice catch, slime!
To be fair, they did link the english version, so i kinda did not assume that.
thx,i copied the Chinese old version and post the English version XD,it’s embarrassed

Re: Graphics.setMode doesnt work!!

Posted: Wed Jan 03, 2018 5:55 am
by Neer
slime wrote: Fri Dec 29, 2017 2:55 pm It looks like the chinese translation of the tutorial hasn't been updated since before 0.9.0 came out.
thx,that’s true