Question

I have a C++ Library With Functions that I would like to integrate with Scratch. I need to be able to make the blocks have certain code and then export the code as a .cpp file. I am able to edit the source if I need to. I have searched but I have not found anything that I directly add new code into the blocks. I have found Create from scratch, or build up on Scratch? and http://dimeb.informatik.uni-bremen.de/eduwear/date/2007/03/ and I think I many do something like the second link, but I would like to know if there is a way just to extend Scratch? Thanks for all your help.

Was it helpful?

Solution

You could use two techniques.

1) Use BYOB instead of Scratch. BYOB is a branch of Scratch created at Berkeley, it is similar in its blocks interface, but is much more flexible - and in particular, it has file output and string handling capabilities.

2) Use the Scratch network communication, remote sensor connection. It's been used to connect Scratch to various outside tools, it could communicate to a C++ library. Basically, it communicates its variables and events, and listens to messages, through port 42001.

BYOB also supports the Scratch network, so you could use both. An alternative would be to customise Scratch into a version that support your tools using squeak. But a BYOB library would probably be easier to share.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top