Micircle / scratch3.0-note

scratch 3.0 开发笔记
https://micircle.github.io/scratch3.0-note/
356 stars 104 forks source link

如何在scratch-vm中调用scratch-gui的方法 #12

Open weijiahui1 opened 4 years ago

weijiahui1 commented 4 years ago

您好,想问下 如何在scratch-vm中调用scratch-gui的方法

Micircle commented 4 years ago

什么方法,举个例子

weijiahui1 commented 4 years ago

比如我知道某个代码块的运行函数了,我想在这个函数运行结束的时候执行自己的函数 但是这个函数是在 scratch-gui 项目中写的。

Micircle commented 4 years ago

你可以在 vm.runtime._primitives 中拿到所有舞台积木的运行函数,可以改写这里的方法,不知道是不是你想要的

weijiahui1 commented 4 years ago

我看到了这个方法,现在问题的重点是,怎么能监听到这个函数是否执行呢?