在什么都没有之前,我很高兴加入这个伟大的社区。问题是,我有一个叫做 Character 的 JavaScript 类:
var Character = function()
{
// ..Some previous Properties / Methods (included one called "StareDown()")..
// And this method:
this.GrabDown = function()
{
Context.clearRect(0, 0, CanvasWidth, CanvasHeight);
//Context.fillRect(0, 0, CanvasWidth, CanvasHeight);
Context.drawImage(this.GrabbingDown, CharacterX, CharacterY, SpriteWidth, SpriteHeight);
window.setTimeout
(
function()
{
// Here is where I want to call the parent class method "StareDown()", but I don't know how.
},
250
);
}
}
那么这是我的一个重要问题,如何通过子匿名函数访问父方法?我已经尝试了整整一晚上但是没有找到有帮助的信息。谢谢!