diff --git a/build/tizen/CMakeLists.txt b/build/tizen/CMakeLists.txt index bc137c2..24a666e 100644 --- a/build/tizen/CMakeLists.txt +++ b/build/tizen/CMakeLists.txt @@ -16,6 +16,10 @@ ELSE() SET(BINDIR ${PREFIX}/bin) ENDIF() +# Directory for compiled Emscripten artifacts along with Emscripten examples and demos. +SET(EMSCRIPTEN_ENV_DIR ${PREFIX}/share/emscripten) +SET(EMSCRIPTEN_EXAMPLE_DIR ${ROOT_SRC_DIR}/emscripten-examples/) + SET(RESOURCE_DIR ${ROOT_SRC_DIR}/resources) SET(LOCAL_IMAGES_DIR ${RESOURCE_DIR}/images) SET(LOCAL_MODELS_DIR ${RESOURCE_DIR}/models) @@ -93,3 +97,7 @@ INCLUDE_DIRECTORIES(${DEMO_SRC_DIR}) ADD_SUBDIRECTORY(demo) ADD_SUBDIRECTORY(examples) ADD_SUBDIRECTORY(builder) + +CONFIGURE_FILE( ${EMSCRIPTEN_EXAMPLE_DIR}/dali-toy.js ${EMSCRIPTEN_ENV_DIR} ) +CONFIGURE_FILE( ${EMSCRIPTEN_EXAMPLE_DIR}/dali-toy.html ${EMSCRIPTEN_ENV_DIR} ) +CONFIGURE_FILE( ${EMSCRIPTEN_EXAMPLE_DIR}/dali-doc-demo.html ${EMSCRIPTEN_ENV_DIR} ) diff --git a/emscripten-examples/dali-doc-demo.html b/emscripten-examples/dali-doc-demo.html new file mode 100644 index 0000000..d6a9c95 --- /dev/null +++ b/emscripten-examples/dali-doc-demo.html @@ -0,0 +1,130 @@ + +
+ + + +
+ mScript = Dali::Toolkit::Script::New();
+ mScript.ExecuteFile( mScriptFileName);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/emscripten-examples/dali-toy.html b/emscripten-examples/dali-toy.html
new file mode 100644
index 0000000..4e9c997
--- /dev/null
+++ b/emscripten-examples/dali-toy.html
@@ -0,0 +1,627 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ See numbered examples in Javascript Buffer tab.
+ DALi helper variables ++dali.actor; // currently selected (clicked) actor or null ++ DALi toy helper functions +
+dali.actor.position = [0,100,0]; // property access via dot notation +shader.weight = 3; // uniforms access from shader object +col = collectByName(); // collect all actors on stage for dotted notation access +col.picture_4_png.position = [100,0,0]; + +clear(); // Clear all. If things are still funky right click the reload button + // Open developer console, click "Empty Cache and hard reload" (chrome) ++ +
" + + "(Parent: " + parent.name + " [" + parent.getId() + "] (" + parent.position + ")" + + " Anchored: " + actor.anchorPoint + "" + + " ParentOrigin: " + actor.parentOrigin + " )" + + "
"; + elem.appendChild(p); + } + + if( actorId in actorIdToShaderSet && + "shaderEffect" in actorIdToShaderSet[actorId]) { // if has compiled + var shaderOptions = actorIdToShaderSet[actorId]; + var uniforms = dali.sourceUniformMetaData(shaderOptions.vertex); + uniforms = uniforms.concat(dali.sourceUniformMetaData(shaderOptions.fragment)); + + var shader = getShader(actor); + + if(uniforms.length) { + gridBlock = document.createElement("div"); + gridBlock.className = "row"; + + nameBlock = document.createElement("div"); + nameBlock.className = "col-md-5"; + nameBlock.innerHTML = "Shader Uniforms:"; + gridBlock.appendChild(nameBlock); + + valueBlock = document.createElement("div"); + valueBlock.className = "col-md-7"; + valueBlock.innerHTML = ""; + gridBlock.appendChild(valueBlock); + + elem.appendChild(gridBlock); + + for(i = 0; i < uniforms.length; i++) { + var type = uniforms[i].type; + name = uniforms[i].name; + gridBlock = document.createElement("div"); + gridBlock.className = "row"; + + nameBlock = document.createElement("div"); + nameBlock.className = "col-md-5"; + nameBlock.innerHTML = type + " " + name + " (Animatable) "; + + gridBlock.appendChild(nameBlock); + + valueBlock = document.createElement("div"); + valueBlock.className = "col-md-7"; + valueBlock.innerHTML = shader[ name ]; + gridBlock.appendChild(valueBlock); + + elem.appendChild(gridBlock); + + } + } + + } + + // getproperties returns std::vector