Comments (5)
ext.currentTrigger = null;
ext.getsEvent = function(which) {
if (ext.currentTrigger === which) {
ext.currentTrigger = null;
// Do stuff
}
};
ext.sendsEvent = function(which) {
ext.currentTrigger = which;
};
ext.descriptor = {
blocks: [
['h', 'when event %s sent', 'getsEvent', 'evt1']
[' ', 'send event %s', 'sendsEvent', 'evt1']
]
};
As for "special" events such as what could be 'greenFlag'
, I'm not sure how you would send those. Probably like you said, ext.trigger("special")
?
Note - not tested, but should work.. :P
from scratch-extension-docs.
@liam4 That's exactly the kind of code I'm hoping to avoid..
from scratch-extension-docs.
@bobbybee I see what you mean, but while they don't implement it, it'll work. :P
from scratch-extension-docs.
that's an interesting idea which we may implement at some point. The current implementation supports having hat blocks that accept arguments and we wanted that flexibility. For example, you can currently put a reporter from one extension into a hat block argument of another extension.
from scratch-extension-docs.
@bobbybee Thanks for the suggestion! We have moved the content in this repo to https://github.com/LLK/scratchx/, would you please re-open this feature request on that repo?
from scratch-extension-docs.
Related Issues (13)
- What can it do? HOT 2
- Can not poll data from HID if there is no data returned. HOT 2
- Extension blocks no longer loaded when an .sb2 file is uploaded HOT 2
- ext._shutdown() not called when extension is removed HOT 2
- Add [Deprecated] to repo description HOT 1
- Feature Request HOT 9
- Incorrect Terminology in http://llk.github.io/scratch-extension-docs/
- HID device does not support choosing Interface HOT 1
- Give developer access to source code of scratch for debugging HOT 1
- Add the ability to stop all scripts HOT 1
- Add a combined string/integer/menu argument type
- Include a block divider HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scratch-extension-docs.