Add Front Buffer Rendering Sample (#5735)
authorChihun Jeong <50663828+ANZ1217@users.noreply.github.com>
Fri, 10 Nov 2023 08:35:09 +0000 (17:35 +0900)
committerJaehyun Cho <jaehyun0cho@gmail.com>
Wed, 15 Nov 2023 08:56:46 +0000 (17:56 +0900)
Co-authored-by: ANZ1217 <chihun.jeong@samsung.com>
test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/WindowFrontBufferRenderingSample.cs [new file with mode: 0644]

diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/WindowFrontBufferRenderingSample.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/WindowFrontBufferRenderingSample.cs
new file mode 100644 (file)
index 0000000..6ee5b75
--- /dev/null
@@ -0,0 +1,72 @@
+
+using global::System;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Samples
+{
+    using log = Tizen.Log;
+
+    public class WindowFrontBufferRenderingSample : IExample
+    {
+        const string tag = "NUITEST";
+        private View view;
+        private Window window;
+        private TextLabel textlabel;
+        private Animation animation;
+
+        public void Activate()
+        {
+            WindowData newWindowData = new WindowData()
+            {
+                PositionSize = new Rectangle(0, 0, 600, 300),
+                WindowMode = NUIApplication.WindowMode.Opaque,
+                WindowType = WindowType.Normal,
+                FrontBufferRendering = true,
+            };
+
+            bool result = false;
+            result = newWindowData.FrontBufferRendering;
+            log.Fatal(tag, $"Current Front Buffer Rendering: {result}\n");
+
+            window = new Window("new Window", newWindowData);
+
+            view = new View()
+            {
+                PositionUsesPivotPoint = true,
+                PivotPoint = PivotPoint.Center,
+                ParentOrigin = ParentOrigin.Center,
+                WidthResizePolicy = ResizePolicyType.FillToParent,
+                HeightResizePolicy = ResizePolicyType.FillToParent,
+                BackgroundColor = Color.Black,
+            };
+
+            textlabel = new TextLabel()
+            {
+                Text = $"Current Front Buffer Rendering: {result}\n",
+                PointSize = 30.0f,
+                TextColor = Color.Blue,
+                ParentOrigin = ParentOrigin.Center,
+                PivotPoint = PivotPoint.Center,
+                PositionUsesPivotPoint = true,
+                HorizontalAlignment = HorizontalAlignment.Center,
+                VerticalAlignment = VerticalAlignment.Center,
+            };
+
+            animation = new Animation(2000);
+            animation.AnimateTo(textlabel, "Orientation", new Rotation(new Radian(new Degree(180.0f)), PositionAxis.X), 0, 1000);
+            animation.AnimateTo(textlabel, "Orientation", new Rotation(new Radian(new Degree(0.0f)), PositionAxis.X), 1000, 2000);
+            animation.Looping = true;
+            animation.Play();
+
+            view.Add(textlabel);
+
+            window.Add(view);
+            window.Show();
+        }
+
+        public void Deactivate()
+        {
+
+        }
+    }
+}