X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=docs%2Fcontent%2Fshared-javascript-and-cpp-documentation%2Fcontrol-renderers.md;h=4581cb0ce88bfc81b178f50e66a94030b00fa0af;hb=27649fa487f2913206331c98e41ea5787001061e;hp=6930b031b4d8f692cb8378224106587196d9c037;hpb=f5cb40c6bbbf566541637d09126e1f3c1984de89;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/docs/content/shared-javascript-and-cpp-documentation/control-renderers.md b/docs/content/shared-javascript-and-cpp-documentation/control-renderers.md index 6930b03..4581cb0 100644 --- a/docs/content/shared-javascript-and-cpp-documentation/control-renderers.md +++ b/docs/content/shared-javascript-and-cpp-documentation/control-renderers.md @@ -31,7 +31,7 @@ Renders a solid color to the control's quad. ### Properties Supported -**RendererType:** "color" +**RendererType:** "COLOR" | Property Name | Type | Required | Description | |---------------|:-------:|:--------:|---------------------------| @@ -44,7 +44,7 @@ Renders a solid color to the control's quad. Dali::Toolkit::Control control = Dali::Toolkit::Control::New(); Dali::Property::Map map; -map[ "rendererType" ] = "color"; +map[ "rendererType" ] = "COLOR"; map[ "mixColor" ] = Color::RED; control.SetProperty( Dali::Toolkit::Control::Property::BACKGROUND, map ); @@ -56,7 +56,7 @@ var control = new dali.Control( "Control" ); control.background = { - rendererType : "color", + rendererType : "COLOR", mixColor : dali.COLOR_RED }; ~~~ @@ -74,18 +74,18 @@ Both Linear and Radial gradients are supported. ### Properties Supported -**RendererType:** "gradient" +**RendererType:** "GRADIENT" -| Property Name | Type | Required | Description | -|--------------------------------------------------------------|:----------------:|:----------:|-------------------------------------------------------------------------| -| startPosition | VECTOR2 | For Linear | The start position of the linear gradient. | -| endPosition | VECTOR2 | For Linear | The end position of the linear gradient. | -| center | VECTOR2 | For Radial | The center point of the gradient. | -| radius | FLOAT | For Radial | The size of the radius. | -| stopOffset | ARRAY of FLOAT | No | All the stop offsets. If not supplied default is 0.0 and 1.0 | -| stopColor | ARRAY of VECTOR4 | Yes | The color at those stop offsets. At least 2 required to show a gradient | -| [gradientUnits](@ref gradient-renderer-units) | STRING | No | *objectBoundingBox* or *userSpace*. Default: *objectBoundingBox*. | -| [gradientSpreadMethod](@ref gradient-renderer-spread-method) | STRING | No | *pad*, *repeat* or *reflect*. Default: *pad* | +| Property Name | Type | Required | Description | +|------------------------------------------------------|:----------------:|:----------:|--------------------------------------------------------------------------| +| startPosition | VECTOR2 | For Linear | The start position of the linear gradient. | +| endPosition | VECTOR2 | For Linear | The end position of the linear gradient. | +| center | VECTOR2 | For Radial | The center point of the gradient. | +| radius | FLOAT | For Radial | The size of the radius. | +| stopOffset | ARRAY of FLOAT | No | All the stop offsets. If not supplied default is 0.0 and 1.0. | +| stopColor | ARRAY of VECTOR4 | Yes | The color at those stop offsets. At least 2 required to show a gradient. | +| [units](@ref gradient-renderer-units) | STRING | No | *OBJECT_BOUNDING_BOX* or *USER_SPACE*. Default: *OBJECT_BOUNDING_BOX*. | +| [spreadMethod](@ref gradient-renderer-spread-method) | STRING | No | *PAD*, *REFLECT* or *REPEAT*. Default: *PAD*. | If the *stopOffset* and *stopColor* arrays do not have the same number of elements, then the minimum of the two is used as the stop points. @@ -95,10 +95,10 @@ Defines the coordinate system for the attributes: + Start (x1, y1) and End (x2 and y2) points of a line if using a linear gradient. + Center point (cx, cy) and radius (r) of a circle if using a radial gradient. -| Value | Description | -|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------| -| objectBoundingBox | *Default*. Uses the normals for the start, end & center points, i.e. top-left is (-0.5, -0.5) and bottom-right it (0.5, 0.5). | -| userSpace | Uses the user coordinates for the start, end & center points, i.e. in a 200 by 200 control, top-left is (0, 0) and bottom-right is (200, 200). | +| Value | Description | +|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------| +| OBJECT_BOUNDING_BOX | *Default*. Uses the normals for the start, end & center points, i.e. top-left is (-0.5, -0.5) and bottom-right is (0.5, 0.5). | +| USER_SPACE | Uses the user coordinates for the start, end & center points, i.e. in a 200 by 200 control, top-left is (0, 0) and bottom-right is (200, 200). | ### Spread Method {#gradient-renderer-spread-method} @@ -106,9 +106,9 @@ Indicates what happens if the gradient starts or ends inside the bounds of the t | Value | Description | |---------|------------------------------------------------------------------------------------------------------| -| pad | *Default*. Uses the terminal colors of the gradient to fill the remainder of the quad. | -| reflect | Reflect the gradient pattern start-to-end, end-to-start, start-to-end etc. until the quad is filled. | -| repeat | Repeat the gradient pattern start-to-end, start-to-end, start-to-end until the quad is filled. | +| PAD | *Default*. Uses the terminal colors of the gradient to fill the remainder of the quad. | +| REFLECT | Reflect the gradient pattern start-to-end, end-to-start, start-to-end etc. until the quad is filled. | +| REPEAT | Repeat the gradient pattern start-to-end, start-to-end, start-to-end etc. until the quad is filled. | ### Usage @@ -118,7 +118,7 @@ Indicates what happens if the gradient starts or ends inside the bounds of the t Dali::Toolkit::Control control = Dali::Toolkit::Control::New(); Dali::Property::Map map; -map[ "rendererType" ] = "gradient"; +map[ "rendererType" ] = "GRADIENT"; map[ "startPosition" ] = Vector2( 0.5f, 0.5f ); map[ "endPosition" ] = Vector2( -0.5f, -0.5f ); @@ -147,7 +147,7 @@ var control = new dali.Control( "Control" ); control.background = { - rendererType : "gradient", + rendererType : "GRADIENT", startPosition : [ 0.5, 0.5 ], endPosition : [ -0.5, -0.5 ], stopOffset : [ 0.0, 0.3, 0.6, 0.8, 1.0 ], @@ -167,7 +167,7 @@ control.background = Dali::Toolkit::Control control = Dali::Toolkit::Control::New(); Dali::Property::Map map; -map[ "rendererType" ] = "gradient"; +map[ "rendererType" ] = "GRADIENT"; map[ "center" ] = Vector2( 0.5f, 0.5f ); map[ "radius" ] = 1.414f; @@ -196,7 +196,7 @@ var control = new dali.Control( "Control" ); control.background = { - rendererType : "gradient", + rendererType : "GRADIENT", center : [ 0.5, 0.5 ], radius : 1.414, stopOffset : [ 0.0, 0.3, 0.6, 0.8, 1.0 ], @@ -232,15 +232,15 @@ Renders a raster image ( jpg, png etc.) into the control's quad. #### Properties Supported -**RendererType:** "image" +**RendererType:** "IMAGE" -| Property Name | Type | Required | Description | -|--------------------|:--------:|:--------:|-------------------------------------------------------------------------------------------------------------------------------------------------| -| url | STRING | Yes | The URL of the image. | -| [fittingMode](@ref resourceimagescaling-fittingmode) | STRING | No | *SHRINK_TO_FIT*, *SCALE_TO_FILL*, *FIT_WIDTH* or *FIT_HEIGHT*. Default: *SHRINK_TO_FIT*. | -| [samplingMode](@ref resourceimagescaling-scaling) | STRING | No | *BOX*, *NEAREST*, *LINEAR*, *BOX_THEN_NEAREST*, *BOX_THEN_LINEAR*, *NO_FILTERr* or *DONT_CARE*. Default: *BOX*. | -| desiredWidth | INT | No | The desired image width. Will use actual image width if not specified. | -| desiredHeight | INT | No | The desired image height. Will use actual image height if not specified. | +| Property Name | Type | Required | Description | +|------------------------------------------------------|:--------:|:--------:|----------------------------------------------------------------------------------------------------------------| +| url | STRING | Yes | The URL of the image. | +| [fittingMode](@ref resourceimagescaling-fittingmode) | STRING | No | *SHRINK_TO_FIT*, *SCALE_TO_FILL*, *FIT_WIDTH* or *FIT_HEIGHT*. Default: *SHRINK_TO_FIT*. | +| [samplingMode](@ref resourceimagescaling-scaling) | STRING | No | *BOX*, *NEAREST*, *LINEAR*, *BOX_THEN_NEAREST*, *BOX_THEN_LINEAR*, *NO_FILTER* or *DONT_CARE*. Default: *BOX*. | +| desiredWidth | INT | No | The desired image width. Will use actual image width if not specified. | +| desiredHeight | INT | No | The desired image height. Will use actual image height if not specified. | #### Usage @@ -249,7 +249,7 @@ Renders a raster image ( jpg, png etc.) into the control's quad. Dali::Toolkit::Control control = Dali::Toolkit::Control::New(); Dali::Property::Map map; -map[ "rendererType" ] = "image"; +map[ "rendererType" ] = "IMAGE"; map[ "url" ] = "path-to-image.jpg"; control.SetProperty( Dali::Toolkit::Control::Property::BACKGROUND, map ); @@ -261,7 +261,7 @@ var control = new dali.Control( "Control" ); control.background = { - rendererType : "image", + rendererType : "IMAGE", url : "path-to-image.jpg" }; ~~~ @@ -276,7 +276,7 @@ Renders an n-patch or a 9-patch image into the control's quad. #### Properties Supported -**RendererType:** "image" +**RendererType:** "IMAGE" | Property Name | Type | Required | Description | |---------------|:-------:|:--------:|----------------------------------| @@ -291,7 +291,7 @@ Dali::Toolkit::Control control = Dali::Toolkit::Control::New(); Dali::Property::Map map; -map[ "rendererType" ] = "image"; +map[ "rendererType" ] = "IMAGE"; map[ "url" ] = "path-to-image.9.png"; control.SetProperty( Dali::Toolkit::Control::Property::BACKGROUND, map ); @@ -303,7 +303,7 @@ var control = new dali.Control( "Control" ); control.background = { - rendererType : "image", + rendererType : "IMAGE", url : "path-to-image.9.png" }; ~~~ @@ -347,7 +347,7 @@ Renders a svg image into the control's quad. #### Properties Supported -**RendererType:** "image" +**RendererType:** "IMAGE" | Property Name | Type | Required | Description | |---------------|:-------:|:--------:|----------------------------------| @@ -361,7 +361,7 @@ Dali::Toolkit::Control control = Dali::Toolkit::Control::New(); Dali::Property::Map map; -map[ "rendererType" ] = "image"; +map[ "rendererType" ] = "IMAGE"; map[ "url" ] = "path-to-image.svg"; control.SetSize( 200.f, 200.f ); @@ -374,7 +374,7 @@ var control = new dali.Control( "Control" ); control.background = { - rendererType : "image", + rendererType : "IMAGE", url : "path-to-image.svg" }; ~~~ @@ -389,7 +389,7 @@ Renders a solid color as an internal border to the control's quad. ### Properties Supported -**RendererType:** "border" +**RendererType:** "BORDER" | Property Name | Type | Required | Description | |---------------|:-------:|:--------:|--------------------------------------------------| @@ -405,7 +405,7 @@ Dali::Toolkit::Control control = Dali::Toolkit::Control::New(); Dali::Property::Map map; -map[ "rendererType" ] = "border"; +map[ "rendererType" ] = "BORDER"; map[ "borderColor" ] = Color::BLUE; map[ "borderSize" ] = 5.0f; @@ -418,7 +418,7 @@ var control = new dali.Control( "Control" ); control.background = { - rendererType : "border", + rendererType : "BORDER", borderColor : dali.COLOR_BLUE, borderSize = 5 }; @@ -435,14 +435,26 @@ Renders a mesh using a .obj file, optionally with textures provided by a mtl fil ### Properties Supported -**RendererType** "mesh" +**RendererType** "MESH" -| Property Name | Type | Required | Description | -|---------------|:-------:|:------------------:|----------------------------------------------------------------------| -| objectUrl | STRING | Yes | The location of the .obj file. | -| materialUrl | STRING | No | The location of the .mtl file. Leave blank for a textureless object. | -| texturesPath | STRING | If using material | Path to the directory textures (including gloss and normal) are stored in. | -| shaderType | STRING | No | Sets the type of shader to be used with the mesh. Note that if anything the shader requires is missing, it will use a simpler one that it can handle with what has been supplied.\n Possible values: "textureless", "diffuseTexture", "allTextures". | +| Property Name | Type | Required | Description | +|----------------------------------------------|:-------:|:------------------:|--------------------------------------------------------------------------------| +| objectUrl | STRING | Yes | The location of the ".obj" file. | +| materialUrl | STRING | No | The location of the ".mtl" file. Leave blank for a textureless object. | +| texturesPath | STRING | If using material | Path to the directory the textures (including gloss and normal) are stored in. | +| [shaderType](@ref mesh-renderer-shader-type) | STRING | No | Sets the type of shader to be used with the mesh. | + +### Shader Type {#mesh-renderer-shader-type} + +When specifying the shader type, if anything the shader requires is missing, a simpler type that can be handled with what has been supplied will be used instead. + +**Possible values:** + +| String Value | Description | +|-----------------|------------------------------------------------| +| TEXTURELESS | *Simplest*. A flat color with shading is used. | +| DIFFUSE_TEXTURE | Textured. | +| ALL_TEXTURES | Has a gloss, normal map and texture map. | ### Usage @@ -452,7 +464,7 @@ Dali::Toolkit::Control control = Dali::Toolkit::Control::New(); Dali::Property::Map map; -map[ "rendererType" ] = "mesh"; +map[ "rendererType" ] = "MESH"; map[ "objectUrl" ] = "home/models/Dino.obj"; map[ "materialUrl" ] = "home/models/Dino.mtl"; map[ "texturesPath" ] = "home/images/";