Esempio n. 1
0
        public override Widget build(BuildContext context)
        {
            Widget result = this.widget.useCachedNetworkImage
                ? new CachedNetworkImage(
                src: this.widget.url,
                placeholder: this.widget.placeholder,
                fit: BoxFit.contain,
                headers: this.widget.headers,
                onImageResolved: this._onImageResolved)
                : this._imageInfo != null
                    ? new RawImage(image: this._imageInfo.image, fit: BoxFit.contain)
                    : this.widget.placeholder;

            result = new ScaleTransition(
                scale: this._scaleAnimation, child: result);

            result = new FractionalTranslation(
                translation: this._position,
                child: result);

            result = new GestureDetector(
                onScaleStart: this._onScaleStart,
                onScaleUpdate: this._onScaleUpdate,
                onScaleEnd: this._onScaleEnd,
                onDoubleTap: this._onDoubleTap,
                child: result);

            result = new Hero(
                tag: this.widget.url,
                flightShuttleBuilder: (_1, _2, _3, _4, _5) => { return(result); },
                child: result);

            return(result);
        }
Esempio n. 2
0
        public void ScaleTransitionConstructor()
        {
            tlog.Debug(tag, $"ScaleTransitionConstructor START");

            var testingTarget = new ScaleTransition();

            Assert.IsNotNull(testingTarget, "Return a null object of FontClient");
            Assert.IsInstanceOf <ScaleTransition>(testingTarget, "Should be an instance of ScaleTransition type.");

            testingTarget.Dispose();
            tlog.Debug(tag, $"ScaleTransitionConstructor END (OK)");
        }
Esempio n. 3
0
    void Awake()
    {
        var t = Resources.Load <TextAsset>("kernel");

        codeLines = t.text.Split('\n').Select(x => x.TrimEnd()).Where(x => x.Length > 0).ToArray();

        st = gameObject.AddComponent <ScaleTransition>();

        adminWindow = transform.parent.Find("Scan Window").gameObject;
        adminMeter  = adminWindow.transform.Find("Scan Meter").gameObject;

        adminSt = adminWindow.AddComponent <ScaleTransition>();

        adminWindow.transform.localScale = Vector3.zero;
        transform.parent.localScale      = Vector3.zero;
        Visible = false;
    }
Esempio n. 4
0
        public void ScaleTransitionScaleFactor()
        {
            tlog.Debug(tag, $"ScaleTransitionScaleFactor START");

            var testingTarget = new ScaleTransition();

            Assert.IsNotNull(testingTarget, "Return a null object of FontClient");
            Assert.IsInstanceOf <ScaleTransition>(testingTarget, "Should be an instance of ScaleTransition type.");

            using (Vector2 sf = new Vector2(100.0f, 200.0f))
            {
                testingTarget.ScaleFactor = sf;
                tlog.Debug(tag, "Opacity : " + testingTarget.ScaleFactor);
            }

            testingTarget.Dispose();
            tlog.Debug(tag, $"ScaleTransitionScaleFactor END (OK)");
        }
Esempio n. 5
0
    void Awake()
    {
        var text  = Resources.Load <TextAsset>("ClickyText");
        var lines = text.text.Split('|').Select(x => x.Trim());

        foreach (var l in lines)
        {
            var id     = l.Substring(0, l.IndexOf('\n'));
            var talkie = l.Substring(l.IndexOf('\n') + 1);

            Dialogue.Add(id.Trim(), talkie.Trim());
            //Debug.Log("id = " + id + " | talkie = " + talkie);
        }

        Instance = this;

        st = gameObject.AddComponent <ScaleTransition>();

        BaseScale = AssociatedWindow.transform.localScale;
        AssociatedWindow.transform.localScale = Vector3.zero;

        ClickyAvatar = AssociatedWindow.transform.Find("Image").GetComponent <Image>();
        ReturnIcon   = AssociatedWindow.transform.Find("Return").GetComponent <Image>();
    }
        public void Activate()
        {
            Window  window     = NUIApplication.GetDefaultWindow();
            Vector2 windowSize = new Vector2((float)(window.Size.Width), (float)(window.Size.Height));

            magnification = Math.Min(windowSize.X / baseSize.X, windowSize.Y / baseSize.Y);
            contentSize   = baseSize * magnification;

            navigator = new Navigator()
            {
                WidthResizePolicy  = ResizePolicyType.FillToParent,
                HeightResizePolicy = ResizePolicyType.FillToParent,
                Transition         = new Transition()
                {
                    TimePeriod    = new TimePeriod(400),
                    AlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseInOutSine),
                },
            };
            window.Add(navigator);

            View mainRoot = new View()
            {
                WidthResizePolicy  = ResizePolicyType.FillToParent,
                HeightResizePolicy = ResizePolicyType.FillToParent
            };

            View layoutView = new View()
            {
                PositionUsesPivotPoint = true,
                PivotPoint             = PivotPoint.BottomCenter,
                ParentOrigin           = ParentOrigin.BottomCenter,
                Layout = new LinearLayout()
                {
                    LinearAlignment   = LinearLayout.Alignment.Center,
                    LinearOrientation = LinearLayout.Orientation.Horizontal,
                    CellPadding       = new Size(convertSize(60), convertSize(60)),
                },
                Position = new Position(0, -convertSize(30))
            };

            mainRoot.Add(layoutView);

            View redButton   = CreateButton(TileColor[0], Keywords[0, 0], Keywords[0, 1], redPage);
            View greenButton = CreateButton(TileColor[1], Keywords[1, 0], Keywords[1, 1], greenPage);
            View blueButton  = CreateButton(TileColor[2], Keywords[2, 0], Keywords[2, 1], bluePage);

            layoutView.Add(redButton);
            layoutView.Add(greenButton);
            layoutView.Add(blueButton);


            TransitionGroup transitionGroup = new TransitionGroup()
            {
                UseGroupAlphaFunction = true,
                AlphaFunction         = new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseInOut),
            };
            SlideTransition slide = new SlideTransition()
            {
                TimePeriod    = new TimePeriod(400),
                AlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default),
                Direction     = SlideTransitionDirection.Top
            };

            transitionGroup.AddTransition(slide);
            FadeTransition fade = new FadeTransition()
            {
                Opacity       = 0.3f,
                TimePeriod    = new TimePeriod(400),
                AlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default)
            };

            transitionGroup.AddTransition(fade);
            ScaleTransition scale = new ScaleTransition()
            {
                ScaleFactor   = new Vector2(0.3f, 0.3f),
                TimePeriod    = new TimePeriod(400),
                AlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default)
            };

            transitionGroup.AddTransition(scale);

            mainPage = new ContentPage()
            {
                BackgroundColor        = Color.Transparent,
                Content                = mainRoot,
                DisappearingTransition = new ScaleTransition()
                {
                    TimePeriod    = new TimePeriod(500),
                    AlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default),
                    ScaleFactor   = new Vector2(0.5f, 1.5f)
                },
                AppearingTransition = transitionGroup,
            };
            navigator.Push(mainPage);

            View totalGreyView = new View()
            {
                Size              = new Size(convertSize(50), convertSize(50)),
                CornerRadius      = convertSize(25),
                BackgroundColor   = ColorGrey,
                TransitionOptions = new TransitionOptions()
                {
                    TransitionTag = totalGreyTag,
                }
            };

            totalGreyView.TouchEvent += (object sender, View.TouchEventArgs e) =>
            {
                if (e.Touch.GetState(0) == PointStateType.Down)
                {
                    navigator.PushWithTransition(totalPage);
                }
                return(true);
            };
            layoutView.Add(totalGreyView);


            // ------------------------------------------------------


            View totalPageRoot = new View()
            {
                WidthResizePolicy = ResizePolicyType.FillToParent,
                SizeHeight        = contentSize.Height,
            };

            View totalLayoutView = new View()
            {
                Layout = new GridLayout()
                {
                    Rows            = 2,
                    GridOrientation = GridLayout.Orientation.Vertical,
                },
                PositionUsesPivotPoint = true,
                PivotPoint             = PivotPoint.Center,
                ParentOrigin           = ParentOrigin.Center,
            };

            totalPageRoot.Add(totalLayoutView);

            for (int i = 0; i < 3; ++i)
            {
                View sizeView = new View()
                {
                    Size = new Size(contentSize.Width / 2.0f, contentSize.Height / 2.0f),
                };
                View smallView = CreatePageScene(TileColor[i], Keywords[i, 0], Keywords[i, 1]);
                smallView.Scale = new Vector3(0.45f, 0.45f, 1.0f);
                smallView.PositionUsesPivotPoint = true;
                smallView.PivotPoint             = PivotPoint.Center;
                smallView.ParentOrigin           = ParentOrigin.Center;
                sizeView.Add(smallView);
                totalLayoutView.Add(sizeView);
            }

            View sizeGreyView = new View()
            {
                Size = new Size(contentSize.Width / 2.0f, contentSize.Height / 2.0f),
            };

            View totalGreyReturnView = new View()
            {
                PositionUsesPivotPoint = true,
                PivotPoint             = PivotPoint.Center,
                ParentOrigin           = ParentOrigin.Center,
                Size              = new Size(convertSize(70), convertSize(70)),
                CornerRadius      = convertSize(20),
                BackgroundColor   = ColorGrey,
                TransitionOptions = new TransitionOptions()
                {
                    TransitionTag = totalGreyTag,
                }
            };

            sizeGreyView.Add(totalGreyReturnView);
            totalLayoutView.Add(sizeGreyView);

            totalGreyReturnView.TouchEvent += (object sender, View.TouchEventArgs e) =>
            {
                if (e.Touch.GetState(0) == PointStateType.Down)
                {
                    navigator.PopWithTransition();
                }
                return(true);
            };

            totalPage = new ContentPage()
            {
                BackgroundColor     = Color.Transparent,
                Content             = totalPageRoot,
                AppearingTransition = new FadeTransition()
                {
                    TimePeriod    = new TimePeriod(500),
                    AlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default),
                },
                DisappearingTransition = new FadeTransition()
                {
                    TimePeriod    = new TimePeriod(500),
                    AlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default),
                },
            };
        }