private void SetupInnerPageCubeEffect() { Vector2 stageSize = NUIApplication.GetDefaultWindow().WindowSize; Path path = new Path(); PropertyArray points = new PropertyArray(); points.PushBack(new PropertyValue(new Vector3(stageSize.X * 0.5f, 0.0f, stageSize.X * 0.5f))); points.PushBack(new PropertyValue(new Vector3(0.0f, 0.0f, 0.0f))); points.PushBack(new PropertyValue(new Vector3(-stageSize.X * 0.5f, 0.0f, stageSize.X * 0.5f))); path.Points = points; PropertyArray controlPoints = new PropertyArray(); controlPoints.PushBack(new PropertyValue(new Vector3(stageSize.X * 0.5f, 0.0f, stageSize.X * 0.3f))); controlPoints.PushBack(new PropertyValue(new Vector3(stageSize.X * 0.3f, 0.0f, 0.0f))); controlPoints.PushBack(new PropertyValue(new Vector3(-stageSize.X * 0.3f, 0.0f, 0.0f))); controlPoints.PushBack(new PropertyValue(new Vector3(-stageSize.X * 0.5f, 0.0f, stageSize.X * 0.3f))); path.ControlPoints = controlPoints; mScrollViewEffect = new ScrollViewPagePathEffect(path, new Vector3(-1.0f, 0.0f, 0.0f), ScrollView.Property.ScrollFinalX, new Vector3(stageSize.X * TABLE_RELATIVE_SIZE.X, stageSize.Y * TABLE_RELATIVE_SIZE.Y, 0.0f), mTotalPages); }
private void SetupInnerPageCubeEffect() { Vector2 stageSize = Window.Instance.WindowSize; Path path = new Path(); PropertyArray points = new PropertyArray(); points.PushBack(new PropertyValue(new Vector3(stageSize.X * 0.5f, 0.0f, stageSize.X * 0.5f))); points.PushBack(new PropertyValue(new Vector3(0.0f, 0.0f, 0.0f))); points.PushBack(new PropertyValue(new Vector3(-stageSize.X * 0.5f, 0.0f, stageSize.X * 0.5f))); path.Points = points; PropertyArray controlPoints = new PropertyArray(); controlPoints.PushBack(new PropertyValue(new Vector3(stageSize.X * 0.5f, 0.0f, stageSize.X * 0.3f))); controlPoints.PushBack(new PropertyValue(new Vector3(stageSize.X * 0.3f, 0.0f, 0.0f))); controlPoints.PushBack(new PropertyValue(new Vector3(-stageSize.X * 0.3f, 0.0f, 0.0f))); controlPoints.PushBack(new PropertyValue(new Vector3(-stageSize.X * 0.5f, 0.0f, stageSize.X * 0.3f))); path.ControlPoints = controlPoints; mScrollViewEffect = new ScrollViewPagePathEffect(path, new Vector3(-1.0f, 0.0f, 0.0f), ScrollView.Property.SCROLL_FINAL_X, new Vector3(stageSize.X * TABLE_RELATIVE_SIZE.X, stageSize.Y * TABLE_RELATIVE_SIZE.Y, 0.0f), mTotalPages); }
public void ScrollViewPagePathEffectDownCast() { tlog.Debug(tag, $"ScrollViewPagePathEffectDownCast START"); using (Path path = new Path()) { using (Vector3 forword = new Vector3(2, 4, 6)) { using (Vector3 pageSize = new Vector3(6, 8, 10)) { var testingTarget = new ScrollViewPagePathEffect(path, forword, 1, pageSize, 5); Assert.IsNotNull(testingTarget, "Can't create success object ScrollViewPagePathEffect"); Assert.IsInstanceOf <ScrollViewPagePathEffect>(testingTarget, "Should be an instance of ScrollViewPagePathEffect type."); var result = ScrollViewPagePathEffect.DownCast(testingTarget); Assert.IsNotNull(result, "Can't create success object ScrollViewPagePathEffect"); Assert.IsInstanceOf <ScrollViewPagePathEffect>(result, "Should be an instance of ScrollViewPagePathEffect type."); testingTarget.Dispose(); } } } tlog.Debug(tag, $"ScrollViewPagePathEffectDownCast END (OK)"); }
public void ScrollViewPagePathEffectApplyToPage() { tlog.Debug(tag, $"ScrollViewPagePathEffectApplyToPage START"); using (Path path = new Path()) { using (Vector3 forword = new Vector3(2, 4, 6)) { using (Vector3 pageSize = new Vector3(6, 8, 10)) { var testingTarget = new ScrollViewPagePathEffect(path, forword, 1, pageSize, 5); Assert.IsNotNull(testingTarget, "Can't create success object ScrollViewPagePathEffect"); Assert.IsInstanceOf <ScrollViewPagePathEffect>(testingTarget, "Should be an instance of ScrollViewPagePathEffect type."); try { using (View view = new View()) { testingTarget.ApplyToPage(view, 2); } } catch (Exception e) { tlog.Debug(tag, e.Message.ToString()); Assert.Fail("Caught Exception: Failed!"); } testingTarget.Dispose(); } } } tlog.Debug(tag, $"ScrollViewPagePathEffectApplyToPage END (OK)"); }