/// <summary>
 /// Create a PrimitiveVisual.
 /// </summary>
 /// <param name="type">the type of the shape</param>
 /// <returns>return a primitiveVisual</returns>
 private Tizen.NUI.PrimitiveVisual CreatePrimitiveVisual(PrimitiveVisualShapeType type)
 {
     Tizen.NUI.PrimitiveVisual primitiveVisual = new Tizen.NUI.PrimitiveVisual();
     primitiveVisual.Shape           = type;
     primitiveVisual.BevelPercentage = 0.3f;
     primitiveVisual.BevelSmoothness = 0.0f;
     primitiveVisual.ScaleDimensions = new Vector3(1.0f, 1.0f, 0.3f);
     primitiveVisual.MixColor        = new Vector4((245.0f / 255.0f), (188.0f / 255.0f), (73.0f / 255.0f), 1.0f);
     return(primitiveVisual);
 }
예제 #2
0
 /// <summary>
 /// Create a PrimitiveVisual.
 /// </summary>
 /// <param name="type">the type of the shape</param>
 /// <param name="position">the position of the primitiveVisual</param>
 /// <returns>return a primitiveVisual</returns>
 private Tizen.NUI.PrimitiveVisual CreatePrimitiveVisual(PrimitiveVisualShapeType type, Vector2 position)
 {
     Tizen.NUI.PrimitiveVisual primitiveVisual = new Tizen.NUI.PrimitiveVisual();
     primitiveVisual.Shape           = type;
     primitiveVisual.BevelPercentage = 0.3f;
     primitiveVisual.BevelSmoothness = 0.0f;
     primitiveVisual.ScaleDimensions = new Vector3(1.0f, 1.0f, 0.3f);
     primitiveVisual.MixColor        = new Vector4((245.0f / 255.0f), (188.0f / 255.0f), (73.0f / 255.0f), 1.0f);
     primitiveVisual.Size            = new Vector2(200.0f, 200.0f);
     primitiveVisual.Position        = position;
     primitiveVisual.PositionPolicy  = VisualTransformPolicyType.Absolute;
     primitiveVisual.SizePolicy      = VisualTransformPolicyType.Absolute;
     primitiveVisual.Origin          = Visual.AlignType.TopBegin;
     primitiveVisual.AnchorPoint     = Visual.AlignType.TopBegin;
     return(primitiveVisual);
 }
예제 #3
0
        /// <summary>
        /// Create TableView, Create pushButtons and add them to tableView.
        /// </summary>
        private void Populate()
        {
            Vector2 stagesize = Window.Instance.Size;

            Tizen.NUI.VisualMap  imageVisual = CreateVisualMap("Image", new Vector2(60, 100.0f), image_jpg);
            Tizen.NUI.TextVisual imageText   = CreateTextVisual("ImageVisual", new Vector2(60, 0.0f));
            _visualView.AddVisual("imageVisual", imageVisual);
            _visualView.AddVisual("imageText", imageText);

            Tizen.NUI.VisualMap  gifVisual = CreateVisualMap("Animated", new Vector2(460, 100.0f), image_gif);
            Tizen.NUI.TextVisual gifText   = CreateTextVisual("AnimatedImageVisual", new Vector2(460, 0.0f));
            _visualView.AddVisual("gifVisual", gifVisual);
            _visualView.AddVisual("gifText", gifText);

            Tizen.NUI.VisualMap  colorVisual = CreateVisualMap("Color", new Vector2(860, 100.0f), image_gif);
            Tizen.NUI.TextVisual colorText   = CreateTextVisual("ColorVisual", new Vector2(860, 0.0f));
            _visualView.AddVisual("colorVisual", colorVisual);
            _visualView.AddVisual("colorText", colorText);

            VisualView svgView = new VisualView();

            svgView.PositionUsesPivotPoint = true;
            svgView.ParentOrigin           = ParentOrigin.TopLeft;
            svgView.PivotPoint             = PivotPoint.TopLeft;
            svgView.Position2D             = new Position2D(1280, 100);
            svgView.Size2D = new Size2D(200, 200);
            _visualView.Add(svgView);

            Tizen.NUI.VisualMap  svgVisual = CreateVisualMap("SVG", new Vector2(0, 0.0f), image_svg);
            Tizen.NUI.TextVisual svgText   = CreateTextVisual("SVGVisual", new Vector2(1260, 0.0f));
            svgView.AddVisual("svgVisual", svgVisual);
            _visualView.AddVisual("svgText", svgText);

            Tizen.NUI.VisualMap  nPatchVisual = CreateVisualMap("NPatch", new Vector2(1660, 100.0f), image_9patch);
            Tizen.NUI.TextVisual nPatchText   = CreateTextVisual("NPatchVisual", new Vector2(1660, 0.0f));
            _visualView.AddVisual("nPatchVisual", nPatchVisual);
            _visualView.AddVisual("nPatchText", nPatchText);

            VisualView borderView = new VisualView();

            borderView.BackgroundColor        = new Color(43.0f / 255.0f, 145.0f / 255.0f, 175.0f / 255.0f, 1.0f);
            borderView.PositionUsesPivotPoint = true;
            borderView.ParentOrigin           = ParentOrigin.TopLeft;
            borderView.PivotPoint             = PivotPoint.TopLeft;
            borderView.Position2D             = new Position2D(80, 400);
            borderView.Size2D = new Size2D(200, 200);
            _visualView.Add(borderView);
            Tizen.NUI.VisualMap  borderVisual = CreateVisualMap("Border", new Vector2(0, 0.0f), image_9patch);
            Tizen.NUI.TextVisual borderText   = CreateTextVisual("BorderVisual", new Vector2(60, 300.0f));
            borderView.AddVisual("borderVisual", borderVisual);
            _visualView.AddVisual("borderText", borderText);

            Tizen.NUI.VisualMap  gradientVisual = CreateVisualMap("Gradient", new Vector2(460, 400.0f), image_9patch);
            Tizen.NUI.TextVisual gradientText   = CreateTextVisual("GradientVisual", new Vector2(460, 300.0f));
            _visualView.AddVisual("gradientVisual", gradientVisual);
            _visualView.AddVisual("gradientText", gradientText);

            // primitive visual: Cone
            // Renders a simple 3D shape, such as a cube or sphere. Scaled to fit the control.
            // The shapes are generated with clockwise winding and backface culling on by default.
            // Cone : Equivalent to a conical frustrum with the top radius of zero
            Tizen.NUI.PrimitiveVisual cone     = CreatePrimitiveVisual(PrimitiveVisualShapeType.Cone, new Vector2(860, 400));
            Tizen.NUI.TextVisual      coneText = CreateTextVisual("Cone", new Vector2(860, 300.0f));
            _visualView.AddVisual("coneText", coneText);
            _visualView.AddVisual("cone", cone);

            // primitive visual: Sphere
            // Sphere : A perfectly round geometrical object in the three-dimensional space
            Tizen.NUI.PrimitiveVisual sphere     = CreatePrimitiveVisual(PrimitiveVisualShapeType.Sphere, new Vector2(1260, 400.0f));
            Tizen.NUI.TextVisual      sphereText = CreateTextVisual("Sphere", new Vector2(1260, 300.0f));
            _visualView.AddVisual("sphereText", sphereText);
            _visualView.AddVisual("sphere", sphere);

            // primitive visual: Cylinder
            // Cylinder : Equivalent to a conical frustrum with the top radius of zero
            Tizen.NUI.PrimitiveVisual cylinder     = CreatePrimitiveVisual(PrimitiveVisualShapeType.Cylinder, new Vector2(1660, 400.0f));
            Tizen.NUI.TextVisual      cylinderText = CreateTextVisual("Cylinder", new Vector2(1660, 300.0f));
            _visualView.AddVisual("cylinderText", cylinderText);
            _visualView.AddVisual("cylinder", cylinder);

            // primitive visual: ConicalFrustrum
            // ConicalFrustrum : Equivalent to a conical frustrum with
            // equal radii for the top and bottom circles.
            Tizen.NUI.PrimitiveVisual conicalFrustrum     = CreatePrimitiveVisual(PrimitiveVisualShapeType.ConicalFrustrum, new Vector2(60.0f, 700));
            Tizen.NUI.TextVisual      conicalFrustrumText = CreateTextVisual("ConicalFrustrum", new Vector2(60.0f, 600.0f));
            _visualView.AddVisual("conicalFrustrumText", conicalFrustrumText);
            _visualView.AddVisual("conicalFrustrum", conicalFrustrum);

            // primitive visual: Cube
            // Cube : Equivalent to a conical frustrum with equal radii for the top and bottom
            //     circles.
            Tizen.NUI.PrimitiveVisual cube     = CreatePrimitiveVisual(PrimitiveVisualShapeType.Cube, new Vector2(460.0f, 700.0f));
            Tizen.NUI.TextVisual      cubeText = CreateTextVisual("Cube", new Vector2(460.0f, 600.0f));
            _visualView.AddVisual("cubeText", cubeText);
            _visualView.AddVisual("cube", cube);

            // primitive visual: Octahedron
            // Equivalent to a bevelled cube with a bevel percentage of zero
            Tizen.NUI.PrimitiveVisual octahedron = CreatePrimitiveVisual(PrimitiveVisualShapeType.Octahedron, new Vector2(860.0f, 700.0f));
            Tizen.NUI.TextVisual      octaheText = CreateTextVisual("Octahedron", new Vector2(860.0f, 600.0f));
            _visualView.AddVisual("octaheText", octaheText);
            _visualView.AddVisual("octahedron", octahedron);

            // primitive visual: BevelledCube
            // BevelledCube : Equivalent to a bevelled cube with a bevel percentage of one
            Tizen.NUI.PrimitiveVisual bevelledCube     = CreatePrimitiveVisual(PrimitiveVisualShapeType.BevelledCube, new Vector2(1260, 700.0f));
            Tizen.NUI.TextVisual      bevelledCubeText = CreateTextVisual("BevelledCube", new Vector2(1260, 600.0f));
            _visualView.AddVisual("bevelledCubeText", bevelledCubeText);
            _visualView.AddVisual("bevelledCube", bevelledCube);
        }