scratch 擴(kuò)展

scratch 擴(kuò)展

ID:36035460

大?。?65.68 KB

頁數(shù):7頁

時(shí)間:2019-04-29

scratch 擴(kuò)展_第1頁
scratch 擴(kuò)展_第2頁
scratch 擴(kuò)展_第3頁
scratch 擴(kuò)展_第4頁
scratch 擴(kuò)展_第5頁
資源描述:

《scratch 擴(kuò)展》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。

1、CreatingScratch2.0Extensions進(jìn)行Scratch2.0擴(kuò)展JohnMaloney約翰·馬拉納MITMediaLaboratory麻省多媒體實(shí)驗(yàn)室September,20132013年9月NOTE1:Thisspecificationsupersedesallearlierdrafts.注解1:這份說明書取代了所有早期版本NOTE2:Thisspecificationisstillpreliminaryandmaychange.注解2:這份說明書仍然是初稿并且會(huì)被修改Introduction介紹Scratch2.0ca

2、nbeextendedtocontrolexternaldevices(e.g.roboticskits,musicalinstruments)andtoaccessdatafromexternalsensorhardware(e.g.sensorboards).AScratch2.0extensionextendsScratchwithacollectionofcommandandreporterblocksthatcanbeusedtointeractwithaparticulardevice.Whenanextensionisenabl

3、ed,itsblocksappearinthe"MoreBlocks"palette.Scratch2.0可以被擴(kuò)展到外部設(shè)備(例如:機(jī)器配件,樂器),也可以獲取來自外部硬件傳感器(例如:傳感器板)的數(shù)據(jù)。Scratch2.0擴(kuò)展模塊通過命令收集和記錄組塊,使Scratch可以被用于和特殊設(shè)備進(jìn)行互動(dòng)。當(dāng)擴(kuò)展啟動(dòng)時(shí),它的擴(kuò)展組塊在”MoreBlocks”控制面板顯示。Duetobrowsersecurityrestrictions,Scratch2.0cannotinteractwithhardwaredevicesdirectly.Inst

4、ead,hardwareextensionscomewithahelperapp,aseparateapplicationthattheusermustinstallandrunontheircomputer.ScratchcommunicateswiththehelperappviaHTTPrequests,andthehelperapptalkstothehardware.Inthefuture,someextensionsmaypackagetheirhelperappsasbrowserplugins,butthatmechanism

5、isnotdescribedhere.由于瀏覽器安全限制,Scratch2.0不能和硬件設(shè)備直接互動(dòng)。而是通過一個(gè)用戶必須安裝和運(yùn)行在電腦上的獨(dú)立應(yīng)用程序?qū)崿F(xiàn)對硬件的擴(kuò)展。Scratch通過HTTP請求與幫助程序交流,而幫助程序則和硬件通信。未來,一些拓展會(huì)把幫助程序打包成瀏覽器插件,但原理不在此描述。ThisdocumentisaimedatScratch2.0extensiondevelopers.Itdescribestheextensiondescriptionfileformat,theprotocolusedtocommunica

6、tebetweenScratchextensionhelperapps,andtheextensiondevelopmentprocess.這個(gè)文檔主要為Scratch2.0擴(kuò)展研發(fā)者服務(wù)。這里描述了擴(kuò)展開發(fā)過程的文件格式,曾經(jīng)用于連接Scratch擴(kuò)展輔助程序和擴(kuò)展開發(fā)過程的協(xié)議。Extensiondescriptionfile擴(kuò)展描述文件AnextensiondescriptionfileisatextfileinJSONformat(www.json.org)thatdescribestheextension.Byconvention,

7、aScratch2.0extensionfileendsin.s2e.TheJSONobjectintheextensiondescriptionfileincludestheextension'sname,theTCP/IPportNumberusedtocommunicatewiththeextensionshelperapp,andalistofScratchblockspecifications.Hereisanexample:一個(gè)擴(kuò)展描述文件是一個(gè)JSON格式的文本文件,用以描述擴(kuò)展。通常,Scratch2.0擴(kuò)展文件是以“.s2e

8、”作為文件擴(kuò)展名的。在擴(kuò)展描述文件中,一個(gè)JSON實(shí)例包含擴(kuò)展的名字,用來和輔助應(yīng)用程序通信的TCP/IP端口號(hào)碼和一組組件清單。下面是一個(gè)例子。{"extensi

當(dāng)前文檔最多預(yù)覽五頁,下載文檔查看全文

此文檔下載收益歸作者所有

當(dāng)前文檔最多預(yù)覽五頁,下載文檔查看全文
溫馨提示:
1. 部分包含數(shù)學(xué)公式或PPT動(dòng)畫的文件,查看預(yù)覽時(shí)可能會(huì)顯示錯(cuò)亂或異常,文件下載后無此問題,請放心下載。
2. 本文檔由用戶上傳,版權(quán)歸屬用戶,天天文庫負(fù)責(zé)整理代發(fā)布。如果您對本文檔版權(quán)有爭議請及時(shí)聯(lián)系客服。
3. 下載前請仔細(xì)閱讀文檔內(nèi)容,確認(rèn)文檔內(nèi)容符合您的需求后進(jìn)行下載,若出現(xiàn)內(nèi)容與標(biāo)題不符可向本站投訴處理。
4. 下載文檔時(shí)可能由于網(wǎng)絡(luò)波動(dòng)等原因無法下載或下載錯(cuò)誤,付費(fèi)完成后未能成功下載的用戶請聯(lián)系客服處理。