Scratch 扩展.docx
文本预览下载声明
Creating Scratch 2.0 Extensions进行Scratch2.0扩展John Maloney 约翰·马拉纳MIT Media Laboratory 麻省多媒体实验室September, 2013 2013年9月NOTE 1: This specification supersedes all earlier drafts.注解1:这份说明书取代了所有早期版本NOTE 2: This specification is still preliminary and may change.注解2:这份说明书仍然是初稿并且会被修改Introduction 介绍Scratch 2.0 can be extended to control external devices (e.g. robotics kits, musical instruments) and to access data from external sensor hardware (e.g. sensor boards). A Scratch 2.0 extension extends Scratch with a collection of command and reporter blocks that can be used to interact with a particular device. When an extension is enabled, its blocks appear in the More Blocks palette.Scratch 2.0 可以被扩展到外部设备(例如:机器配件,乐器),也可以获取来自外部硬件传感器(例如:传感器板)的数据。Scratch 2.0扩展模块通过命令收集和记录组块,使Scratch可以被用于和特殊设备进行互动。当扩展启动时,它的扩展组块在”More Blocks”控制面板显示。Due to browser security restrictions, Scratch 2.0 cannot interact with hardware devices directly.Instead, hardware extensions come with a helper app, a separate application that the user mustinstall and run on their computer. Scratch communicates with the helper app via HTTP requests,and the helper app talks to the hardware. In the future, some extensions may package their helper apps as browser plugins, but that mechanism is not described here.由于浏览器安全限制,Scratch 2.0 不能和硬件设备直接互动。而是通过一个用户必须安装和运行在电脑上的独立应用程序实现对硬件的扩展。Scratch通过HTTP请求与帮助程序交流,而帮助程序则和硬件通信。未来,一些拓展会把帮助程序打包成浏览器插件,但原理不在此描述。This document is aimed at Scratch 2.0 extension developers. It describes the extension description file format, the protocol used to communicate between Scratch extension helper apps, and the extension development process.这个文档主要为Scratch2.0 扩展研发者服务。这里描述了扩展开发过程的文件格式,曾经用于连接Scratch扩展辅助程序和扩展开发过程的协议。Extension description file 扩展描述文件An extension description file is a text file in JSON format () that describes the extension. By convention, a Scratch 2.0 extension file ends in .s2e. The JSON object in the extension description file includes the extensions name, the TCP/IP port Number used to c
显示全部