Discuss Scratch
- Discussion Forums
- » Developing Scratch Extensions
- » Different shaped blocks in extensions
- lugga
- Scratcher
500+ posts
Different shaped blocks in extensions
Is there any way to make blocks such as you can in the scratchblocks2 api. What I mean is be able to make blocks that look like the ‘if’ block or ‘repeat’ block.
Let me show you what I want to make
Let me show you what I want to make
for <> in <> do :: cstart
eat soup.
- savaka
- Scratcher
1000+ posts
Different shaped blocks in extensions
You can't make blocks with command inputs in extensions
But I wish you could
But I wish you could
Last edited by savaka (Dec. 12, 2015 16:47:22)
- lugga
- Scratcher
500+ posts
Different shaped blocks in extensions
Yeh me too. You can't make blocks with command inputs in extensions
But I wish you could
- Jonathan50
- Scratcher
1000+ posts
Different shaped blocks in extensions
(function(ext) { ext._shutdown = function() {}; ext._getStatus = function() { return {status: 2, msg: 'Ready'}; }; ext.example_c = function() { alert('Example c block'); }; ext.example_cap = function() { alert('Example cap block'); }; var descriptor = { blocks: [ ['c', 'example c block', 'example_c'], ['f', 'example cap block', 'example_cap'] ] }; ScratchExtensions.register('Example Blocks', descriptor, ext); })({});
Not yet a Knight of the Mu Calculus.
- lugga
- Scratcher
500+ posts
Different shaped blocks in extensions
Do you think you could test something like this:You can, but the C blocks are pretty useless because I don't think you can make them run the scripts inside the block…(function(ext) { ext._shutdown = function() {}; ext._getStatus = function() { return {status: 2, msg: 'Ready'}; }; ext.example_c = function() { alert('Example c block'); }; ext.example_cap = function() { alert('Example cap block'); }; var descriptor = { blocks: [ ['c', 'example c block', 'example_c'], ['f', 'example cap block', 'example_cap'] ] }; ScratchExtensions.register('Example Blocks', descriptor, ext); })({});
(function(ext) { ext._shutdown = function() {}; ext._getStatus = function() { return {status: 2, msg: 'Ready'}; }; ext.example_c = function(blocks) { for (var i in blocks) { // Somehow execute a function depending on block name. Saying that i is something like ['c', 'repeat %s', 'repeat_func'] do something like if (i[1] == 'repeat %s') { function }) } }; ext.example_cap = function() { alert('Example cap block'); }; var descriptor = { blocks: [ ['c', 'example c block', 'example_c'], ['f', 'example cap block', 'example_cap'] ] }; ScratchExtensions.register('Example Blocks', descriptor, ext); })({});
- Jonathan50
- Scratcher
1000+ posts
Different shaped blocks in extensions
I don't think a way to use C-blocks has been implemented yet. Do you think you could test something like this:(function(ext) { ext._shutdown = function() {}; ext._getStatus = function() { return {status: 2, msg: 'Ready'}; }; ext.example_c = function(blocks) { for (var i in blocks) { // Somehow execute a function depending on block name. Saying that i is something like ['c', 'repeat %s', 'repeat_func'] do something like if (i[1] == 'repeat %s') { function }) } }; ext.example_cap = function() { alert('Example cap block'); }; var descriptor = { blocks: [ ['c', 'example c block', 'example_c'], ['f', 'example cap block', 'example_cap'] ] }; ScratchExtensions.register('Example Blocks', descriptor, ext); })({});
I am at school so I can't test as github.io and scratchx are blocked.please reconsider blocking GitHub
Not yet a Knight of the Mu Calculus.
- lugga
- Scratcher
500+ posts
Different shaped blocks in extensions
please reconsider blocking GitHub
What do you mean?
- Jonathan50
- Scratcher
1000+ posts
Different shaped blocks in extensions
Your teachers should reconsider blocking GitHubplease reconsider blocking GitHub
What do you mean?
Not yet a Knight of the Mu Calculus.
- Discussion Forums
- » Developing Scratch Extensions
- » Different shaped blocks in extensions