This site requires JavaScript, please enable it in your browser!
Greenfoot back
Nosson1459
Nosson1459 wrote ...

2023/2/17

getWorldCanvas()

Nosson1459 Nosson1459

2023/2/17

#
I'm trying to fix up someone elses old greenfoot code and I came across an error that I don't know how to fix, the person calls a method called getWorldCanvas() from the WorldHandler class Greenfoot doens't know what it is. What is it trying to do and is there a replacement method for it?
danpost danpost

2023/2/17

#
Nosson1459 wrote...
I'm trying to fix up someone elses old greenfoot code and I came across an error that I don't know how to fix, the person calls a method called getWorldCanvas() from the WorldHandler class Greenfoot doens't know what it is. What is it trying to do and is there a replacement method for it?
I did not research it; but, I believe that it returns a java.awt.Canvas object. Being as you cannot upload anything using the java.awt package without running into security issues in javascript/HTML, any scenario using that package will fail to work on a web page. That has not always been the case as some time back, when applets were being used, it was a usable package. Also, I do not believe that the canvas is accessible anymore thru greenfoot, either.
You need to login to post a reply.