// ---- Gradient for background
mGradientMap.Insert("rendererType", "gradient");
+
Property::Array stopOffsets;
stopOffsets.PushBack( 0.0f );
stopOffsets.PushBack( 0.3f );
stopOffsets.PushBack( 0.6f );
stopOffsets.PushBack( 0.8f );
- stopOffsets.PushBack( 1.f );
- mGradientMap.Insert("gradientStopOffset", stopOffsets);
+ stopOffsets.PushBack( 1.0f );
+ mGradientMap.Insert("stopOffset", stopOffsets );
+
Property::Array stopColors;
stopColors.PushBack( Vector4( 129.f, 198.f, 193.f, 255.f )/255.f );
stopColors.PushBack( Vector4( 196.f, 198.f, 71.f, 122.f )/255.f );
stopColors.PushBack( Vector4( 214.f, 37.f, 139.f, 191.f )/255.f );
stopColors.PushBack( Vector4( 129.f, 198.f, 193.f, 150.f )/255.f );
stopColors.PushBack( Color::YELLOW );
- mGradientMap.Insert("gradientStopColor", stopColors);
+ mGradientMap.Insert("stopColor", stopColors);
OnChangeIconClicked( changeButton );
}
{
case 0: // linear gradient with units as objectBoundingBox
{
- gradientMap.Insert("gradientStartPosition", Vector2( 0.5f, 0.5f ));
- gradientMap.Insert("gradientEndPosition", Vector2( -0.5f, -0.5f ));
+ gradientMap.Insert("startPosition", Vector2( 0.5f, 0.5f ));
+ gradientMap.Insert("endPosition", Vector2( -0.5f, -0.5f ));
break;
}
case 1: // linear gradient with units as userSpaceOnUse
{
Vector2 halfStageSize = Stage::GetCurrent().GetSize()*0.5f;
- gradientMap.Insert("gradientStartPosition", halfStageSize);
- gradientMap.Insert("gradientEndPosition", -halfStageSize );
- gradientMap.Insert("gradientUnits", "userSpace");
+ gradientMap.Insert("startPosition", halfStageSize);
+ gradientMap.Insert("endPosition", -halfStageSize );
+ gradientMap.Insert("units", "userSpace");
break;
}
case 2: // radial gradient with units as objectBoundingBox
{
- gradientMap.Insert("gradientCenter", Vector2(0.5f, 0.5f));
- gradientMap.Insert("gradientRadius", 1.414f);
+ gradientMap.Insert("center", Vector2(0.5f, 0.5f));
+ gradientMap.Insert("radius", 1.414f);
break;
}
default: // radial gradient with units as userSpaceOnUse
{
Vector2 stageSize = Stage::GetCurrent().GetSize();
- gradientMap.Insert("gradientCenter", stageSize*0.5f);
- gradientMap.Insert("gradientRadius", stageSize.Length());
- gradientMap.Insert("gradientUnits", "userSpace");
+ gradientMap.Insert("center", stageSize*0.5f);
+ gradientMap.Insert("radius", stageSize.Length());
+ gradientMap.Insert("units", "userSpace");
break;
}
}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+{
+ // a tree of actors
+ "stage": [{
+ "type": "Control",
+ "size": [400,600,1],
+ "parentOrigin": "CENTER",
+ "anchorPoint": "CENTER",
+ "background": {
+ "rendererType" : "gradient",
+ "startPosition" : [-0.5, -0.5],
+ "endPosition": [0.5,0.5],
+ "stopColor" : [
+ [1,0,0,1],
+ [1,0.25,0,1],
+ [1,0.5,0,1],
+ [1,0.75,0,1],
+ [1,1,0,1]
+ ],
+ "stopOffset" : [ 0, 0.25, 0.5, 0.75, 1.0 ]
+ }
+ }]
+}
"background":
{
"rendererType": "gradient",
- "gradientCenter": [240, 400],
- "gradientRadius": 932,
- "gradientUnits": "userSpace",
- "gradientStopColor": [[0.247,0.38,0.52,1.0],[0.055,0.18,0.286,1.0]],
- "gradientStopOffset":[0.0,1.0]
+ "center": [240, 400],
+ "radius": 932,
+ "units": "userSpace",
+ "stopColor": [[0.247,0.38,0.52,1.0],[0.055,0.18,0.286,1.0]]
}
}
}
"background":
{
"rendererType": "gradient",
- "gradientCenter": [360, 640],
- "gradientRadius": 1468,
- "gradientUnits": "userSpace",
- "gradientStopColor": [[0.247,0.38,0.52,1.0],[0.055,0.18,0.286,1.0]],
- "gradientStopOffset":[0.0,1.0]
+ "center": [360, 640],
+ "radius": 1468,
+ "units": "userSpace",
+ "stopColor": [[0.247,0.38,0.52,1.0],[0.055,0.18,0.286,1.0]]
}
}
}