Graphics.setMode doesnt work!!

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.
Post Reply
Neer
Prole
Posts: 4
Joined: Tue Dec 26, 2017 9:26 am

Graphics.setMode doesnt work!!

Post 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~ ;) ;)
User avatar
steVeRoll
Party member
Posts: 131
Joined: Sun Feb 14, 2016 1:13 pm

Re: Graphics.setMode doesnt work!!

Post 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.
Neer
Prole
Posts: 4
Joined: Tue Dec 26, 2017 9:26 am

Re: Graphics.setMode doesnt work!!

Post 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
Attachments
main.lua
(3.56 KiB) Downloaded 124 times
User avatar
zorg
Party member
Posts: 3436
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Graphics.setMode doesnt work!!

Post 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.
Last edited by zorg on Fri Dec 29, 2017 4:30 pm, edited 3 times in total.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
slime
Solid Snayke
Posts: 3131
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Graphics.setMode doesnt work!!

Post by slime »

It looks like the chinese translation of the tutorial hasn't been updated since before 0.9.0 came out.
Neer
Prole
Posts: 4
Joined: Tue Dec 26, 2017 9:26 am

Re: Graphics.setMode doesnt work!!

Post 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
Neer
Prole
Posts: 4
Joined: Tue Dec 26, 2017 9:26 am

Re: Graphics.setMode doesnt work!!

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 56 guests