Пример #1
0
        public CCProgressFromToState(CCProgressFromTo action, CCNode target)
            : base(action, target)
        {
            PercentTo   = action.PercentTo;
            PercentFrom = action.PercentFrom;

            ((CCProgressTimer)(Target)).Percentage = PercentFrom;
        }
Пример #2
0
        public CCProgressFromToState (CCProgressFromTo action, CCNode target)
            : base (action, target)
        { 
            PercentTo = action.PercentTo;
            PercentFrom = action.PercentFrom;

            ((CCProgressTimer)(Target)).Percentage = PercentFrom;
        }
Пример #3
0
        protected override void StartProgressLine()
        {
            StopProgressLine();

            var progressTo = new CCProgressFromTo(_timeBetweenColors, 100, 0);

            _progressTimer.Percentage = 100.0f;
            _progressTimer.Repeat(_lives, progressTo);
        }
Пример #4
0
        protected override void InitialiseScenes()
        {
            if (Layer == null || Viewport == null)
                return;

            base.InitialiseScenes();

            SetupTransition();

            // create a transparent color layer
            // in which we are going to add our rendertextures
            var bounds = Layer.VisibleBoundsWorldspace;
            CCRect viewportRect = Viewport.ViewportInPixels;

            // create the second render texture for outScene
            CCRenderTexture texture = new CCRenderTexture(bounds.Size, viewportRect.Size);
            texture.Position = bounds.Center;
            texture.AnchorPoint = CCPoint.AnchorMiddle;

            // Temporarily add render texture to get layer/scene properties
            AddChild(texture);

            // Render outScene to its texturebuffer
            texture.BeginWithClear(0, 0, 0, 1);
            SceneNodeContainerToBeModified.Visit();
            texture.End();

            // No longer want to render texture
            RemoveChild(texture);

            // Since we've passed the outScene to the texture we don't need it.
            if (SceneNodeContainerToBeModified == OutSceneNodeContainer)
            {
                HideOutShowIn();
            }

            CCProgressTimer node = ProgressTimerNodeWithRenderTexture(texture);

            // create the blend action
            var layerAction = new CCProgressFromTo(Duration, From, To);

            // add the layer (which contains our two rendertextures) to the scene
            AddChild(node, 2, SceneRadial);

            // run the blend action
            node.RunAction(layerAction);

        }
Пример #5
0
        public override object Copy(ICCCopyable pZone)
        {
            CCProgressFromTo pCopy;
            if (pZone != null)
            {
                //in case of being called at sub class
                pCopy = (CCProgressFromTo) (pZone);
            }
            else
            {
                pCopy = new CCProgressFromTo();
                pZone = (pCopy);
            }

            base.Copy(pZone);
            pCopy.InitWithDuration(m_fDuration, m_fFrom, m_fTo);

            return pCopy;
        }
Пример #6
0
        public override object Copy(ICCCopyable pZone)
        {
            CCProgressFromTo pCopy;

            if (pZone != null)
            {
                //in case of being called at sub class
                pCopy = (CCProgressFromTo)(pZone);
            }
            else
            {
                pCopy = new CCProgressFromTo();
                pZone = (pCopy);
            }

            base.Copy(pZone);
            pCopy.InitWithDuration(m_fDuration, m_fFrom, m_fTo);

            return(pCopy);
        }
Пример #7
0
 /// <summary>
 /// Creates and initializes the action with a duration, a "from" percentage and a "to" percentage
 /// </summary>
 public static CCProgressFromTo Create(float duration, float fFromPercentage, float fToPercentage)
 {
     var pProgressFromTo = new CCProgressFromTo();
     pProgressFromTo.InitWithDuration(duration, fFromPercentage, fToPercentage);
     return pProgressFromTo;
 }