" \"parentOrigin\": \"TOP_LEFT\","
" \"anchorPoint\": \"{ANCHOR}\","
" \"padding\": \"{PADDING}\","
- " \"image\": { \"imageUrl\": \"dir/{IMAGE_PATH}\" },"
+ " \"image\": { \"url\": \"dir/{IMAGE_PATH}\" },"
" \"sizeWidth\": \"{WIDTH}\","
" \"signals\": [{"
" \"name\": \"touched\","
" \"name\": \"touched\",\n"
" \"action\": \"quit\"\n"
" }],\n"
- " \"customProperties\": {\n"
+ " \"properties\": {\n"
" \"newproperty\": true\n"
" },\n"
+ " \"animatableProperties\": {\n"
+ " \"newAnimatableproperty\": 3\n"
+ " },\n"
" \"actors\": [\n"
" {\n"
" \"type\":\"ImageView\",\n"
Property::Value value = actor.GetProperty(index);
DALI_TEST_CHECK( value.Get<bool>() == true );
+ index = actor.GetPropertyIndex("newAnimatableproperty");
+ DALI_TEST_CHECK( Property::INVALID_INDEX != index );
+ value = actor.GetProperty(index);
+ DALI_TEST_CHECK( value.Get<int>() == 3 );
+
END_TEST;
}
-int UtcDaliBuilderShaderEffectP(void)
+int UtcDaliBuilderCustomShaderP(void)
{
ToolkitTestApplication application;
" \"size\": [200, 200, 0],\n"
" \"effect\": \"Ripple2D\",\n"
" \"image\": {\n"
- " \"filename\": \"{DALI_IMAGE_DIR}gallery-medium-25.jpg\",\n"
- " \"width\": 200,\n"
- " \"height\": 80,\n"
- " \"loadPolicy\": \"IMMEDIATE\",\n"
- " \"releasePolicy\": \"NEVER\"\n"
+ " \"url\": \"{DALI_IMAGE_DIR}gallery-medium-25.jpg\",\n"
+ " \"desiredWidth\": 200,\n"
+ " \"desiredHeight\": 80,\n"
+ " \"shader\": {\n"
+ " \"fragmentShader\": \"precision mediump float;\\nuniform sampler2D sTexture;\\nuniform vec4 uColor;\\nuniform float uAmplitude;\\nuniform float uTime;\\nvarying vec2 vTexCoord;\\nvoid main()\\n{\\n highp vec2 pos = -1.0 + 2.0 * vTexCoord;\\n highp float len = length(pos);\\n highp vec2 texCoord = vTexCoord + pos/len * sin( len * 12.0 - uTime * 4.0 ) * uAmplitude;\\n gl_FragColor = texture2D(sTexture, texCoord) * uColor;}\\n\\n\"\n"
+ " }\n"
+ " },\n"
+ " \"customAnimatableProperties\": {\n"
+ " \"uAmplitude\": 0.02,\n"
+ " \"uTime\": 0.0\n"
" },\n"
" \"signals\": [\n"
" {\n"
" ]\n"
" }\n"
" ],\n"
- " \"paths\": {},\n"
" \"animations\": {\n"
" \"Animation_1\": {\n"
" \"loop\":true,\n"
" \"timePeriod\": {\n"
" \"delay\": 0,\n"
" \"duration\": 10.0\n"
- " },\n"
- " \"gui-builder-timeline-color\": \"#8dc0da\"\n"
+ " }\n"
" }\n"
" ]\n"
" }\n"
- " },\n"
- " \"shaderEffects\": {\n"
- " \"Ripple2D\": {\n"
- " \"program\": {\n"
- " \"vertexPrefix\": \"\",\n"
- " \"vertex\": \"void main(void)\\n{\\n gl_Position = uProjection * uModelView * vec4(aPosition, 1.0);\\n vTexCoord = aTexCoord;\\n}\\n\\n\",\n"
- " \"fragmentPrefix\": \"\",\n"
- " \"fragment\": \"precision mediump float;\\nuniform float uAmplitude; // 0.02; (< 1)\\nuniform float uTime;\\nvoid main()\\n{\\n highp vec2 textureSize = sTextureRect.zw - sTextureRect.xy;\\n highp vec2 pos = -1.0 + 2.0 * vTexCoord.st/textureSize;\\n highp float len = length(pos);\\n highp vec2 texCoord = vTexCoord.st/textureSize + pos/len * sin( len * 12.0 - uTime * 4.0 ) * uAmplitude; \\n gl_FragColor = texture2D(sTexture, texCoord) * uColor;\\n}\\n\\n\\n\",\n"
- " \"geometryType\": \"GEOMETRY_TYPE_IMAGE\"\n"
- " },\n"
- " \"geometryHints\": \"HINT_NONE\",\n"
- " \"gridDensity\": 0,\n"
- " \"loop\": true,\n"
- " \"uAmplitude\": 0.02,\n"
- " \"uTime\": 0.0\n"
- " }\n"
" }\n"
"}\n"
Builder builder = Builder::New();
builder.LoadFromString( json );
- ShaderEffect effect = builder.GetShaderEffect("Ripple2D");
+ builder.AddActors ( "stage", Stage::GetCurrent().GetRootLayer() );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("Image1");
// coverage
- DALI_TEST_CHECK( effect );
+ DALI_TEST_CHECK( actor );
END_TEST;
}
END_TEST;
}
-int UtcDaliBuilderShaderEffect2P(void)
-{
- ToolkitTestApplication application;
-
- // JSON with a quit event when the actor is touched
- std::string json(
- "{\n"
- "\"templates\":\n"
- "{\n"
- " \"imageTree\": { \n"
- " \"type\": \"ImageView\",\n"
- " \"size\": [100,100,1],\n"
- " \"parentOrigin\": [0.5, 0.5, 0.5],\n"
- " \"position\": [\n"
- " 0.40461349487305,\n"
- " 0.9150390625,\n"
- " 0.0\n"
- " ],\n"
- " \"signals\": [{\n"
- " \"name\": \"touched\",\n"
- " \"action\": \"quit\"\n"
- " }],\n"
- " \"actors\": [\n"
- " {\n"
- " \"type\":\"ImageView\",\n"
- " \"name\":\"childImage\" \n"
- " }\n"
- " ]\n"
- " }\n"
- "},\n"
- " \"stage\": [\n"
- " {\n"
- " \"type\": \"imageTree\",\n"
- " \"name\": \"Image1\",\n"
- " \"effect\": \"Ripple2D\",\n"
- " \"image\": \"offscreen\""
- " }\n"
- " ],\n"
- " \"shaderEffects\": {\n"
- " \"Ripple2D\": {\n"
- " \"program\": {\n"
- " \"vertexPrefix\": \"\",\n"
- " \"vertex\": \"void main(void)\\n{\\n gl_Position = uProjection * uModelView * vec4(aPosition, 1.0);\\n vTexCoord = aTexCoord;\\n}\\n\\n\",\n"
- " \"fragmentPrefix\": \"\",\n"
- " \"fragment\": \"precision mediump float;\\nuniform float uAmplitude; // 0.02; (< 1)\\nuniform float uTime;\\nvoid main()\\n{\\n highp vec2 textureSize = sTextureRect.zw - sTextureRect.xy;\\n highp vec2 pos = -1.0 + 2.0 * vTexCoord.st/textureSize;\\n highp float len = length(pos);\\n highp vec2 texCoord = vTexCoord.st/textureSize + pos/len * sin( len * 12.0 - uTime * 4.0 ) * uAmplitude; \\n gl_FragColor = texture2D(sTexture, texCoord) * uColor;\\n}\\n\\n\\n\",\n"
- " \"geometryType\": \"GEOMETRY_TYPE_IMAGE\"\n"
- " },\n"
- " \"geometryHints\": \"HINT_NONE\",\n"
- " \"gridDensity\": 0,\n"
- " \"loop\": true,\n"
- " \"uAmplitude\": 0.02,\n"
- " \"uTime\": 0.0\n"
- " }\n"
- " },\n"
- " \"frameBufferImages\": {\n"
- " \"offscreen\": {\n"
- " \"type\": \"FrameBufferImage\","
- " \"pixelFormat\":\"RGBA8888\","
- " \"width\": 400,"
- " \"height\": 400"
- " }"
- " }"
- "}\n"
-
- );
-
- Builder builder = Builder::New();
- builder.LoadFromString( json );
-
- // coverage
- DALI_TEST_CHECK( true );
-
- END_TEST;
-}
int UtcDaliBuilderAddActorsP(void)
{
" \"parentOrigin\": [0.5, 0.5, 0.5],\n"
" \"effect\": \"Ripple2D\",\n"
" \"image\": {\n"
- " \"imageUrl\": \"{DALI_IMAGE_DIR}gallery-medium-25.jpg\"\n"
+ " \"url\": \"{DALI_IMAGE_DIR}gallery-medium-25.jpg\"\n"
" },\n"
" \"signals\": [\n"
" {\n"
" \"parentOrigin\": [0.5, 0.5, 0.5],\n"
" \"effect\": \"Ripple2D\",\n"
" \"image\": {\n"
- " \"imageUrl\": \"{DALI_IMAGE_DIR}gallery-medium-25.jpg\"\n"
+ " \"url\": \"{DALI_IMAGE_DIR}gallery-medium-25.jpg\"\n"
" },\n"
" \"signals\": [\n"
" {\n"