/** Callback for the change value. */

        public void ValueChanged(Object sender, CCControlEvent controlEvent)
        {
            var pControl = (CCControlStepper)sender;

            // Change value of label.
            DisplayValueLabel.Text = String.Format("{0:0.00}", pControl.Value);
        }
        public void ValueChanged(Object sender, CCControlEvent controlEvent)
        {
            var pControl = (CCControlPotentiometer)sender;

            // Change value of label.
            _displayValueLabel.Text = string.Format("{0:0.00}", pControl.Value);
        }
Esempio n. 3
0
        public void onAnimationsTestClicked(object pSender, CCControlEvent pCCControlEvent)
        {
            // Load node graph (TestAnimations is a sub class of CCLayer) and retrieve the ccb action manager
            CCBAnimationManager actionManager = null;

            /* Create an autorelease CCNodeLoaderLibrary. */
            CCNodeLoaderLibrary ccNodeLoaderLibrary = CCNodeLoaderLibrary.NewDefaultCCNodeLoaderLibrary();

            ccNodeLoaderLibrary.RegisterCCNodeLoader("TestHeaderLayer", new Loader<TestHeaderLayer>());
            ccNodeLoaderLibrary.RegisterCCNodeLoader("TestAnimationsLayer", new Loader<AnimationsTestLayer>());

            /* Create an autorelease CCBReader. */
            var ccbReader = new CCBReader(ccNodeLoaderLibrary);

            /* Read a ccbi file. */
            // Load the scene from the ccbi-file, setting this class as
            // the owner will cause lblTestTitle to be set by the CCBReader.
            // lblTestTitle is in the TestHeader.ccbi, which is referenced
            // from each of the test scenes.
            CCNode animationsTest = ccbReader.ReadNodeGraphFromFile("ccb/ccb/TestAnimations.ccbi", this, ref actionManager);
            ((AnimationsTestLayer) animationsTest).setAnimationManager(actionManager);

            mTestTitleLabelTTF.Label = ("TestAnimations.ccbi");

            CCScene scene = new CCScene();
            scene.AddChild(animationsTest);

            /* Push the new scene with a fancy transition. */
            CCColor3B transitionColor;
            transitionColor.R = 0;
            transitionColor.G = 0;
            transitionColor.B = 0;

            CCDirector.SharedDirector.PushScene(new CCTransitionFade(0.5f, scene, transitionColor));
        }
Esempio n. 4
0
 public void valueChanged(object sender, CCControlEvent controlEvent)
 {
     var pSlider = (CCControlSlider) sender;
     // Change value of label.
     if (pSlider.Tag == 1)
         m_pDisplayValueLabel.Text = (String.Format("Upper slider value = {0:0.00}", pSlider.Value));
     if (pSlider.Tag == 2)
         m_pDisplayValueLabel.Text = (String.Format("Lower slider value = {0:0.00}", pSlider.Value));
 }
Esempio n. 5
0
        /**
         * Returns an CCInvocation object able to construct messages using a given
         * target-action pair. (The invocation may optionnaly include the sender and
         * the event as parameters, in that order)
         *
         * @param target The target object.
         * @param action A selector identifying an action message.
         * @param controlEvent A control events for which the action message is sent.
         * See "CCControlEvent" for constants.
         *
         * @return an CCInvocation object able to construct messages using a given
         * target-action pair.
         */
        //protected CCInvocation invocationWithTargetAndActionForControlEvent(object target, SEL_CCControlHandler action, CCControlEvent controlEvent)
        //{
        //}


        /**
         * Returns the CCInvocation list for the given control event. If the list does
         * not exist, it'll create an empty array before returning it.
         *
         * @param controlEvent A control events for which the action message is sent.
         * See "CCControlEvent" for constants.
         *
         * @return the CCInvocation list for the given control event.
         */
        //<CCInvocation*>
        protected RawList <CCInvocation> DispatchListforControlEvent(CCControlEvent controlEvent)
        {
            RawList <CCInvocation> invocationList;

            if (!m_pDispatchTable.TryGetValue(controlEvent, out invocationList))
            {
                invocationList = new RawList <CCInvocation>(1);

                m_pDispatchTable.Add(controlEvent, invocationList);
            }
            return(invocationList);
        }
 /* Callback for the change value. */
 public void valueChanged(object sender, CCControlEvent controlEvent)
 {
     var pSwitch = (CCControlSwitch) sender;
     if (pSwitch.IsOn())
     {
         m_pDisplayValueLabel.Label = ("On");
     }
     else
     {
         m_pDisplayValueLabel.Label = ("Off");
     }
 }
        public void HueSliderValueChanged(Object sender, CCControlEvent controlEvent)
        {
            Hsv.H = ((CCControlHuePicker)sender).Hue;

            RGBA rgb = CCControlUtils.RGBfromHSV(Hsv);

            // XXX fixed me if not correct
            base.Color = new CCColor3B((byte)(rgb.R * 255.0f), (byte)(rgb.G * 255.0f), (byte)(rgb.B * 255.0f));

            // Send Control callback
            SendActionsForControlEvents(CCControlEvent.ValueChanged);
            UpdateControlPicker();
        }
        public void ColourSliderValueChanged(Object sender, CCControlEvent controlEvent)
        {
            Hsv.S = ((CCControlSaturationBrightnessPicker)sender).Saturation;
            Hsv.V = ((CCControlSaturationBrightnessPicker)sender).Brightness;

            RGBA rgb = CCControlUtils.RGBfromHSV(Hsv);

            // XXX fixed me if not correct
            base.Color = new CCColor3B((byte)(rgb.R * 255.0f), (byte)(rgb.G * 255.0f), (byte)(rgb.B * 255.0f));

            // Send Control callback
            SendActionsForControlEvents(CCControlEvent.ValueChanged);
        }
Esempio n. 9
0
        /* Callback for the change value. */

        public void valueChanged(object sender, CCControlEvent controlEvent)
        {
            var pSwitch = (CCControlSwitch)sender;

            if (pSwitch.On)
            {
                m_pDisplayValueLabel.Text = ("On");
            }
            else
            {
                m_pDisplayValueLabel.Text = ("Off");
            }
        }
Esempio n. 10
0
        public void valueChanged(object sender, CCControlEvent controlEvent)
        {
            var pSlider = (CCControlSlider)sender;

            // Change value of label.
            if (pSlider.Tag == 1)
            {
                m_pDisplayValueLabel.Label = (String.Format("Upper slider value = {0:2}", pSlider.Value));
            }
            if (pSlider.Tag == 2)
            {
                m_pDisplayValueLabel.Label = (String.Format("Lower slider value = {0:2}", pSlider.Value));
            }
        }
        public void ColourSliderValueChanged(Object sender, CCControlEvent controlEvent)
        {
            _hsv.s = ((CCControlSaturationBrightnessPicker)sender).Saturation;
            _hsv.v = ((CCControlSaturationBrightnessPicker)sender).Brightness;


            // Update the value
            RGBA rgb = CCControlUtils.RGBfromHSV(_hsv);

            // XXX fixed me if not correct
            base.Color = new CCColor3B((byte)(rgb.r * 255.0f), (byte)(rgb.g * 255.0f), (byte)(rgb.b * 255.0f));

            // Send Control callback
            SendActionsForControlEvents(CCControlEvent.ValueChanged);
        }
Esempio n. 12
0
        public void onCCControlButtonClicked(object obj, CCControlEvent pCCControlEvent)
        {
            switch (pCCControlEvent)
            {
            case CCControlEvent.TouchDown:
                mCCControlEventLabel.Text = ("Touch Down.");
                break;

            case CCControlEvent.TouchDragInside:
                mCCControlEventLabel.Text = ("Touch Drag Inside.");
                break;

            case CCControlEvent.TouchDragOutside:
                mCCControlEventLabel.Text = ("Touch Drag Outside.");
                break;

            case CCControlEvent.TouchDragEnter:
                mCCControlEventLabel.Text = ("Touch Drag Enter.");
                break;

            case CCControlEvent.TouchDragExit:
                mCCControlEventLabel.Text = ("Touch Drag Exit.");
                break;

            case CCControlEvent.TouchUpInside:
                mCCControlEventLabel.Text = ("Touch Up Inside.");
                break;

            case CCControlEvent.TouchUpOutside:
                mCCControlEventLabel.Text = ("Touch Up Outside.");
                break;

            case CCControlEvent.TouchCancel:
                mCCControlEventLabel.Text = ("Touch Cancel.");
                break;

            case CCControlEvent.ValueChanged:
                mCCControlEventLabel.Text = ("Value Changed.");
                break;

            default:
                Debug.Assert(false);
                break;
            }
        }
Esempio n. 13
0
        /**
         * Sends action messages for the given control events.
         *
         * @param controlEvents A bitmask whose set flags specify the control events for
         * which action messages are sent. See "CCControlEvent" for bitmask constants.
         */

        public virtual void SendActionsForControlEvents(CCControlEvent controlEvents)
        {
            // For each control events
            for (int i = 0; i < kControlEventTotalNumber; i++)
            {
                // If the given controlEvents bitmask contains the curent event
                if ((controlEvents & (CCControlEvent)(1 << i)) != 0)
                {
                    // Call invocations
                    // <CCInvocation*>

                    RawList <CCInvocation> invocationList = DispatchListforControlEvent((CCControlEvent)(1 << i));
                    foreach (CCInvocation invocation in invocationList)
                    {
                        invocation.Invoke(this);
                    }
                }
            }
        }
Esempio n. 14
0
        public void onAnimationsTestClicked(object pSender, CCControlEvent pCCControlEvent)
        {
            // Load node graph (TestAnimations is a sub class of CCLayer) and retrieve the ccb action manager
            CCBAnimationManager actionManager = null;

            /* Create an autorelease CCNodeLoaderLibrary. */
            CCNodeLoaderLibrary ccNodeLoaderLibrary = new CCNodeLoaderLibrary();

            ccNodeLoaderLibrary.RegisterCCNodeLoader("TestHeaderLayer", new Loader <TestHeaderLayer>());
            ccNodeLoaderLibrary.RegisterCCNodeLoader("TestAnimationsLayer", new Loader <AnimationsTestLayer>());


            /* Create an autorelease CCBReader. */
            var ccbReader = new CCBReader(ccNodeLoaderLibrary);

            /* Read a ccbi file. */
            // Load the scene from the ccbi-file, setting this class as
            // the owner will cause lblTestTitle to be set by the CCBReader.
            // lblTestTitle is in the TestHeader.ccbi, which is referenced
            // from each of the test scenes.
            CCNode animationsTest = ccbReader.ReadNodeGraphFromFile("ccb/ccb/TestAnimations.ccbi", this);

            ((AnimationsTestLayer)animationsTest).setAnimationManager(ccbReader.AnimationManager);

            mTestTitleLabelTTF.Text = ("TestAnimations.ccbi");

            CCScene scene = new CCScene(Scene);

            scene.AddChild(animationsTest);

            /* Push the new scene with a fancy transition. */
            CCColor3B transitionColor = new CCColor3B();

            transitionColor.R = 0;
            transitionColor.G = 0;
            transitionColor.B = 0;

            Scene.Director.PushScene(new CCTransitionFade(0.5f, scene, transitionColor));
        }
Esempio n. 15
0
 public void onCCControlButtonClicked(object obj, CCControlEvent pCCControlEvent)
 {
     switch (pCCControlEvent)
     {
         case CCControlEvent.TouchDown:
             mCCControlEventLabel.Text = ("Touch Down.");
             break;
         case CCControlEvent.TouchDragInside:
             mCCControlEventLabel.Text = ("Touch Drag Inside.");
             break;
         case CCControlEvent.TouchDragOutside:
             mCCControlEventLabel.Text = ("Touch Drag Outside.");
             break;
         case CCControlEvent.TouchDragEnter:
             mCCControlEventLabel.Text = ("Touch Drag Enter.");
             break;
         case CCControlEvent.TouchDragExit:
             mCCControlEventLabel.Text = ("Touch Drag Exit.");
             break;
         case CCControlEvent.TouchUpInside:
             mCCControlEventLabel.Text = ("Touch Up Inside.");
             break;
         case CCControlEvent.TouchUpOutside:
             mCCControlEventLabel.Text = ("Touch Up Outside.");
             break;
         case CCControlEvent.TouchCancel:
             mCCControlEventLabel.Text = ("Touch Cancel.");
             break;
         case CCControlEvent.ValueChanged:
             mCCControlEventLabel.Text = ("Value Changed.");
             break;
         default:
             Debug.Assert(false);
             break;
     }
 }
Esempio n. 16
0
 public void onParticleSystemTestClicked(object pSender, CCControlEvent pCCControlEvent)
 {
     openTest("ccb/ccb/TestParticleSystems.ccbi", "TestParticleSystemsLayer", new Loader <ParticleSystemTestLayer>());
 }
Esempio n. 17
0
        public void ColourSliderValueChanged(Object sender, CCControlEvent controlEvent)
        {
            _hsv.s = ((CCControlSaturationBrightnessPicker) sender).Saturation;
            _hsv.v = ((CCControlSaturationBrightnessPicker) sender).Brightness;


            // Update the value
            RGBA rgb = CCControlUtils.RGBfromHSV(_hsv);
            // XXX fixed me if not correct
            base.Color = new CCColor3B((byte) (rgb.r * 255.0f), (byte) (rgb.g * 255.0f), (byte) (rgb.b * 255.0f));

            // Send Control callback
            SendActionsForControlEvents(CCControlEvent.ValueChanged);
        }
Esempio n. 18
0
 public void onTimelineCallbackSoundClicked(object pSender, CCControlEvent pCCControlEvent)
 {
     openTest("ccb/ccb/TestTimelineCallback.ccbi", "TimelineCallbackTestLayer", new Loader <TimelineCallbackTestLayer>());
 }
Esempio n. 19
0
        /**
        * Returns the CCInvocation list for the given control event. If the list does
        * not exist, it'll create an empty array before returning it.
        *
        * @param controlEvent A control events for which the action message is sent.
        * See "CCControlEvent" for constants.
        *
        * @return the CCInvocation list for the given control event.
        */
        //<CCInvocation*>
        protected CCRawList<CCInvocation> DispatchListforControlEvent(CCControlEvent controlEvent)
        {
            CCRawList<CCInvocation> invocationList;
            if (!dispatchTable.TryGetValue(controlEvent, out invocationList))
            {
                invocationList = new CCRawList<CCInvocation>(1);

                dispatchTable.Add(controlEvent, invocationList);
            }
            return invocationList;
        }
Esempio n. 20
0
		public void RemoveTargetWithActionForControlEvent(object target, Action<object, CCControlEvent> action, CCControlEvent controlEvent)
        {
            // Retrieve all invocations for the given control event
            //<CCInvocation*>
            CCRawList<CCInvocation> eventInvocationList = DispatchListforControlEvent(controlEvent);

            //remove all invocations if the target and action are null
            if (target == null && action == null)
            {
                //remove objects
                eventInvocationList.Clear();
            }
            else
            {
                //normally we would use a predicate, but this won't work here. Have to do it manually
                foreach (CCInvocation invocation in eventInvocationList)
                {
                    bool shouldBeRemoved = true;
                    if (target != null)
                    {
                        shouldBeRemoved = (target == invocation.Target);
                    }
                    if (action != null)
                    {
                        shouldBeRemoved = (shouldBeRemoved && (action == invocation.Action));
                    }
                    // Remove the corresponding invocation object
                    if (shouldBeRemoved)
                    {
                        eventInvocationList.Remove(invocation);
                    }
                }
            }
        }
Esempio n. 21
0
 public void onTimelineCallbackSoundClicked(object pSender, CCControlEvent pCCControlEvent)
 {
     openTest("ccb/ccb/TestTimelineCallback.ccbi", "TimelineCallbackTestLayer", new Loader<TimelineCallbackTestLayer>());
 }
Esempio n. 22
0
        /** Callback for the change value. */

        public void ValueChanged(Object sender, CCControlEvent controlEvent)
        {
            var pControl = (CCControlStepper) sender;
            // Change value of label.
            _displayValueLabel.Text = String.Format("{0:0.00}", pControl.Value);
        }
Esempio n. 23
0
 public void onButtonTestClicked(object pSender, CCControlEvent pCCControlEvent)
 {
     openTest("ccb/ccb/TestButtons.ccbi", "TestButtonsLayer", new Loader<ButtonTestLayer>());
 }
Esempio n. 24
0
 public void onMenuTestClicked(object pSender, CCControlEvent pCCControlEvent)
 {
     openTest("ccb/ccb/TestMenus.ccbi", "TestMenusLayer", new Loader<MenuTestLayer>());
 }
Esempio n. 25
0
 public void onCCControlButtonFunkyClicked(object pSender, CCControlEvent pCCControlEvent)
 {
     mAnimationManager.RunAnimationsForSequenceNamedTweenDuration("Funky", 0.3f);
 }
Esempio n. 26
0
 public void touchDragOutsideAction(object sender, CCControlEvent controlEvent)
 {
     m_pDisplayValueLabel.Label = ("Drag Outside");
 }
Esempio n. 27
0
 public void touchCancelAction(object sender, CCControlEvent controlEvent)
 {
     m_pDisplayValueLabel.Text = ("Touch Cancel");
 }
Esempio n. 28
0
 public void touchUpOutsideAction(object sender, CCControlEvent controlEvent)
 {
     m_pDisplayValueLabel.Text = ("Touch Up Outside.");
 }
Esempio n. 29
0
 public void touchDragExitAction(object sender, CCControlEvent controlEvent)
 {
     m_pDisplayValueLabel.Text = ("Drag Exit");
 }
Esempio n. 30
0
 public void onCCControlButtonWaveClicked(object pSender, CCControlEvent pCCControlEvent)
 {
     mAnimationManager.RunAnimations("Wave", 0.3f);
 }
Esempio n. 31
0
 public void onParticleSystemTestClicked(object pSender, CCControlEvent pCCControlEvent)
 {
     openTest("ccb/ccb/TestParticleSystems.ccbi", "TestParticleSystemsLayer", new Loader<ParticleSystemTestLayer>());
 }
Esempio n. 32
0
        public void RemoveTargetWithActionForControlEvent(object target, SEL_CCControlHandler action, CCControlEvent controlEvent)
        {
            // Retrieve all invocations for the given control event
            //<CCInvocation*>
            RawList <CCInvocation> eventInvocationList = DispatchListforControlEvent(controlEvent);

            //remove all invocations if the target and action are null
            if (target == null && action == null)
            {
                //remove objects
                eventInvocationList.Clear();
            }
            else
            {
                //normally we would use a predicate, but this won't work here. Have to do it manually
                foreach (CCInvocation invocation in eventInvocationList)
                {
                    bool shouldBeRemoved = true;
                    if (target != null)
                    {
                        shouldBeRemoved = (target == invocation.Target);
                    }
                    if (action != null)
                    {
                        shouldBeRemoved = (shouldBeRemoved && (action == invocation.Action));
                    }
                    // Remove the corresponding invocation object
                    if (shouldBeRemoved)
                    {
                        eventInvocationList.Remove(invocation);
                    }
                }
            }
        }
Esempio n. 33
0
 public void onScrollViewTestClicked(object pSender, CCControlEvent pCCControlEvent)
 {
     openTest("ccb/ccb/TestScrollViews.ccbi", "TestScrollViewsLayer", new Loader<ScrollViewTestLayer>());
 }
Esempio n. 34
0
 public CCInvocation(object target, SEL_CCControlHandler action, CCControlEvent controlEvent)
 {
     m_target        = target;
     m_pAction       = action;
     m_pControlEvent = controlEvent;
 }
Esempio n. 35
0
 public void onSpriteTestClicked(object pSender, CCControlEvent pCCControlEvent)
 {
     openTest("ccb/ccb/TestSprites.ccbi", "TestSpritesLayer", new Loader<SpriteTestLayer>());
 }
Esempio n. 36
0
 public void touchDownAction(object sender, CCControlEvent controlEvent)
 {
     DisplayValueLabel.Text = ("Touch Down");
 }
		public CCInvocation(object target, Action<object, CCControlEvent> action, CCControlEvent controlEvent)
        {
			Target = target;
			Action = action;
			ControlEvent = controlEvent;
        }
Esempio n. 38
0
		public void AddTargetWithActionForControlEvent(object target, Action<object, CCControlEvent> action, CCControlEvent controlEvent)
        {
            // Create the invocation object
            var invocation = new CCInvocation(target, action, controlEvent);

            // Add the invocation into the dispatch list for the given control event
            CCRawList<CCInvocation> eventInvocationList = DispatchListforControlEvent(controlEvent);
            eventInvocationList.Add(invocation);
        }
Esempio n. 39
0
 public void onButtonTestClicked(object pSender, CCControlEvent pCCControlEvent)
 {
     openTest("ccb/ccb/TestButtons.ccbi", "TestButtonsLayer", new Loader <ButtonTestLayer>());
 }
Esempio n. 40
0
        //virtual ~ControlColourPicker();
        public void HueSliderValueChanged(Object sender, CCControlEvent controlEvent)
        {
            _hsv.h = ((CCControlHuePicker) sender).Hue;

            // Update the value
            RGBA rgb = CCControlUtils.RGBfromHSV(_hsv);
            // XXX fixed me if not correct
            base.Color = new CCColor3B((byte) (rgb.r * 255.0f), (byte) (rgb.g * 255.0f), (byte) (rgb.b * 255.0f));

            // Send Control callback
            SendActionsForControlEvents(CCControlEvent.ValueChanged);
            UpdateControlPicker();
        }
Esempio n. 41
0
 public void onSpriteTestClicked(object pSender, CCControlEvent pCCControlEvent)
 {
     openTest("ccb/ccb/TestSprites.ccbi", "TestSpritesLayer", new Loader <SpriteTestLayer>());
 }
Esempio n. 42
0
 public CCInvocation(object target, Action <object, CCControlEvent> action, CCControlEvent controlEvent)
 {
     _target       = target;
     _action       = action;
     _controlEvent = controlEvent;
 }
Esempio n. 43
0
		public void touchDragExitAction(object sender, CCControlEvent controlEvent)
		{
			m_pDisplayValueLabel.Text = ("Drag Exit");
		}
Esempio n. 44
0
 public void onScrollViewTestClicked(object pSender, CCControlEvent pCCControlEvent)
 {
     openTest("ccb/ccb/TestScrollViews.ccbi", "TestScrollViewsLayer", new Loader <ScrollViewTestLayer>());
 }
Esempio n. 45
0
		public void touchUpOutsideAction(object sender, CCControlEvent controlEvent)
		{
			m_pDisplayValueLabel.Text = ("Touch Up Outside.");
		}
Esempio n. 46
0
        /**
         * Removes a target and action for a particular event (or events) from an
         * internal dispatch table.
         *
         * @param target The target object�that is, the object to which the action
         * message is sent. Pass nil to remove all targets paired with action and the
         * specified control events.
         * @param action A selector identifying an action message. Pass NULL to remove
         * all action messages paired with target.
         * @param controlEvents A bitmask specifying the control events associated with
         * target and action. See "CCControlEvent" for bitmask constants.
         */

        public virtual void RemoveTargetWithActionForControlEvents(object target, SEL_CCControlHandler action, CCControlEvent controlEvents)
        {
            // For each control events
            for (int i = 0; i < kControlEventTotalNumber; i++)
            {
                // If the given controlEvents bitmask contains the curent event
                if ((controlEvents & (CCControlEvent)(1 << i)) != 0)
                {
                    RemoveTargetWithActionForControlEvent(target, action, (CCControlEvent)(1 << i));
                }
            }
        }
Esempio n. 47
0
		public void touchCancelAction(object sender, CCControlEvent controlEvent)
		{
			m_pDisplayValueLabel.Text = ("Touch Cancel");
		}
Esempio n. 48
0
        public void AddTargetWithActionForControlEvent(object target, SEL_CCControlHandler action, CCControlEvent controlEvent)
        {
            // Create the invocation object
            var invocation = new CCInvocation(target, action, controlEvent);

            // Add the invocation into the dispatch list for the given control event
            RawList <CCInvocation> eventInvocationList = DispatchListforControlEvent(controlEvent);

            eventInvocationList.Add(invocation);
        }
        /** Callback for the change value. */

        public void ColourValueChanged(Object sender, CCControlEvent controlEvent)
        {
            CCControlColourPicker pPicker = (CCControlColourPicker)sender;
            _colorLabel.Text = string.Format("#{0:X00}{1:X00}{2:X00}", pPicker.Color.R, pPicker.Color.G, pPicker.Color.B);
        }
Esempio n. 50
0
 public CCInvocation(object target, SEL_CCControlHandler action, CCControlEvent controlEvent)
 {
     m_target = target;
     m_pAction = action;
     m_pControlEvent = controlEvent;
 }
Esempio n. 51
0
 public void onMenuTestClicked(object pSender, CCControlEvent pCCControlEvent)
 {
     openTest("ccb/ccb/TestMenus.ccbi", "TestMenusLayer", new Loader <MenuTestLayer>());
 }
Esempio n. 52
0
        /** Callback for the change value. */

        public void ColourValueChanged(Object sender, CCControlEvent controlEvent)
        {
            CCControlColourPicker pPicker = (CCControlColourPicker)sender;

            _colorLabel.Text = string.Format("#{0:X00}{1:X00}{2:X00}", pPicker.Color.R, pPicker.Color.G, pPicker.Color.B);
        }
Esempio n. 53
0
        /**
         * Sends action messages for the given control events.
         *
         * @param controlEvents A bitmask whose set flags specify the control events for
         * which action messages are sent. See "CCControlEvent" for bitmask constants.
         */

        public virtual void SendActionsForControlEvents(CCControlEvent controlEvents)
        {
            // For each control events
            for (int i = 0; i < ControlEventTotalNumber; i++)
            {
                // If the given controlEvents bitmask contains the curent event
                if ((controlEvents & (CCControlEvent) (1 << i)) != 0)
                {
                    // Call invocations
                    // <CCInvocation*>

                    CCRawList<CCInvocation> invocationList = DispatchListforControlEvent((CCControlEvent) (1 << i));
                    foreach (CCInvocation invocation in invocationList)
                    {
                        invocation.Invoke(this);
                    }
                }
            }
        }
Esempio n. 54
0
 public CCControlEventArgs(CCControlEvent controlEvent)
 {
     ControlEvent = controlEvent;
 }
Esempio n. 55
0
        /**
        * Removes a target and action for a particular event (or events) from an 
        * internal dispatch table.
        *
        * @param target The target object�that is, the object to which the action 
        * message is sent. Pass nil to remove all targets paired with action and the
        * specified control events.
        * @param action A selector identifying an action message. Pass NULL to remove
        * all action messages paired with target.
        * @param controlEvents A bitmask specifying the control events associated with
        * target and action. See "CCControlEvent" for bitmask constants.
        */

		public virtual void RemoveTargetWithActionForControlEvents(object target, Action<object, CCControlEvent> action, CCControlEvent controlEvents)
        {
            // For each control events
            for (int i = 0; i < ControlEventTotalNumber; i++)
            {
                // If the given controlEvents bitmask contains the curent event
                if ((controlEvents & (CCControlEvent) (1 << i)) != 0)
                {
                    RemoveTargetWithActionForControlEvent(target, action, (CCControlEvent) (1 << i));
                }
            }
        }
Esempio n. 56
0
        /**
         * Adds a target and action for a particular event (or events) to an internal
         * dispatch table.
         * The action message may optionnaly include the sender and the event as
         * parameters, in that order.
         * When you call this method, target is not retained.
         *
         * @param target The target object�that is, the object to which the action
         * message is sent. It cannot be nil. The target is not retained.
         * @param action A selector identifying an action message. It cannot be NULL.
         * @param controlEvents A bitmask specifying the control events for which the
         * action message is sent. See "CCControlEvent" for bitmask constants.
         */

        public virtual void AddTargetWithActionForControlEvents(object target, Action <object, CCControlEvent> action, CCControlEvent controlEvents)
        {
            // For each control events
            for (int i = 0; i < kControlEventTotalNumber; i++)
            {
                // If the given controlEvents bitmask contains the curent event
                if (((int)controlEvents & (1 << i)) != 0)
                {
                    AddTargetWithActionForControlEvent(target, action, (CCControlEvent)(1 << i));
                }
            }
        }
Esempio n. 57
0
 public void touchDownAction(object sender, CCControlEvent controlEvent)
 {
     m_pDisplayValueLabel.Label = ("Touch Down");
 }
Esempio n. 58
0
 /**
 * Adds a target and action for a particular event (or events) to an internal
 * dispatch table.
 * The action message may optionnaly include the sender and the event as
 * parameters, in that order.
 * When you call this method, target is not retained.
 *
 * @param target The target object�that is, the object to which the action
 * message is sent. It cannot be nil. The target is not retained.
 * @param action A selector identifying an action message. It cannot be NULL.
 * @param controlEvents A bitmask specifying the control events for which the
 * action message is sent. See "CCControlEvent" for bitmask constants.
 */
 public virtual void AddTargetWithActionForControlEvents(object target, SEL_CCControlHandler action, CCControlEvent controlEvents)
 {
     // For each control events
     for (int i = 0; i < kControlEventTotalNumber; i++)
     {
         // If the given controlEvents bitmask contains the curent event
         if (((int) controlEvents & (1 << i)) != 0)
         {
             AddTargetWithActionForControlEvent(target, action, (CCControlEvent) (1 << i));
         }
     }
 }
        /* Callback for the change value. */

        public void ValueChanged(object sender, CCControlEvent controlEvent)
        {
            var controlSwitch = (CCControlSwitch) sender;
			if (controlSwitch.On)
            {
                DisplayValueLabel.Text = ("On");
            }
            else
            {
                DisplayValueLabel.Text = ("Off");
            }
        }