Programing > Blockly2017 > ġܥåȥڡꤹ

Blockly Developer ToolsWorkspace FactoryǤϡToolboxڡΥɥ֥å뤳ȤǤޤ

Workspace Factoryδ

  1. Blockly Developer ToolsƤӽФ
  2. Workspace Factoryץ֤򥯥å
  3. ToolboxפȡWorkspaceפڤؤ
bdt_workspace_factory.png

Toolboxκ

Toolboxǥ󤹤

Toolboxǥ󤹤ˤϡBlockly Developer ToolsWorkspace FactoryǡToolboxפ򤷤ޤ

¦Υڡ˥֥å¤٤ȡ¦Υڡ˥ץӥ塼ɽޤ

Blockly Developer ToolsBlock FactoryǺä֥å饤֥¸ƤСưŪWorkspace Factoryɤ߹ޤޤ

  1. Toolboxץ֤
  2. ֡ܡץܥǥƥ꡼ɲ
  3. ֥åɲäƥΡYour categoliesפ򤹤
  4. ɲä֥å򡢺¦ΥڡToolboxɥåɥåפ

Code EditorΤ褦ʴ¸Υɥ֥åϡ֡ܡץܥ > Standard categolyפǥݡȤǤޤ

ToolboxExport

  1. Export>Toolbox
  2. ****.xmlȤ¸

ToolboxȤ߹

index.html<xml id="toolbox" style="display: none"></xml>****.xml֤ޤ

ڡΥޥ

ڡꤹ

  1. Workspaceץ֤
  2. ΥڡΥץꤹ

򥨥ݡȤ

  1. Export>Starter Code
  2. workspace.jsȤ¸

ڡȤ߹

index.htmlΥץȤǡworkspaceѿꤹ륪ץworkspace.jsεҤ˽񤭴롣

ʲϡǥ˴ޤޤGenerating JavaScriptindex.htmlξ硣

// before
var workspace = Blockly.inject('blocklyDiv',
       {media: '../../media/',
        toolbox: document.getElementById('toolbox')});
   Blockly.Xml.domToWorkspace(document.getElementById('startBlocks'), workspace);
// after
var workspace = Blockly.inject('blocklyDiv',
      {media: '../../media/',
       toolbox: document.getElementById('toolbox')
	collapse : true, 
	comments : true, 
	disable : false, 
	maxBlocks : Infinity, 
	trashcan : true, 
	horizontalLayout : false, 
	toolboxPosition : 'start', 
	css : true, 
	media : 'https://blockly-demo.appspot.com/static/media/', 
	rtl : false, 
	scrollbars : false, 
	sounds : true, 
	oneBasedIndex : true, 
	grid : {
		spacing : 20, 
		length : 1, 
		colour : '#888', 
		snap : true
	}, 
	zoom : {
		controls : true, 
		wheel : true, 
		startScale : 1, 
		maxScale : 3, 
		minScale : 0.3, 
		scaleSpeed : 1.2
	}});
   Blockly.Xml.domToWorkspace(document.getElementById('startBlocks'), workspace);

Υɥ֥å

ɥ֥å¤٤

  1. Workspaceפ
  2. Υɥ֥åڡ֤

ɥ֥å򥨥ݡȤ

  1. Export>Workspace Block
  2. workspace.xmlȤ¸

ɥ֥åȤ߹

index.html<xml id="startBlocks" style="display: none"></xml>workspace.xml֤ޤ

λݡȤxmlϡid="workspaceBlocks"פˤʤäƤΤǡʲǻꤷid˹碌ޤ

Blockly.Xml.domToWorkspace(document.getElementById('startBlocks'),workspace);

ޤworkspace.xmlidϺۤɤߤ

¾


  ȥå   ʬ Хåå   ñ측 ǽ   إ   ǽRSS
Last-modified: 2017-07-05 () 20:44:01 (621d)