/** 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); }
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)); }
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)); }
/** * 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); }
/* 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"); } }
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); }
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; } }
/** * 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); } } } }
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)); }
public void onParticleSystemTestClicked(object pSender, CCControlEvent pCCControlEvent) { openTest("ccb/ccb/TestParticleSystems.ccbi", "TestParticleSystemsLayer", new Loader <ParticleSystemTestLayer>()); }
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); }
public void onTimelineCallbackSoundClicked(object pSender, CCControlEvent pCCControlEvent) { openTest("ccb/ccb/TestTimelineCallback.ccbi", "TimelineCallbackTestLayer", new Loader <TimelineCallbackTestLayer>()); }
/** * 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; }
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); } } } }
public void onTimelineCallbackSoundClicked(object pSender, CCControlEvent pCCControlEvent) { openTest("ccb/ccb/TestTimelineCallback.ccbi", "TimelineCallbackTestLayer", new Loader<TimelineCallbackTestLayer>()); }
/** 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 onButtonTestClicked(object pSender, CCControlEvent pCCControlEvent) { openTest("ccb/ccb/TestButtons.ccbi", "TestButtonsLayer", new Loader<ButtonTestLayer>()); }
public void onMenuTestClicked(object pSender, CCControlEvent pCCControlEvent) { openTest("ccb/ccb/TestMenus.ccbi", "TestMenusLayer", new Loader<MenuTestLayer>()); }
public void onCCControlButtonFunkyClicked(object pSender, CCControlEvent pCCControlEvent) { mAnimationManager.RunAnimationsForSequenceNamedTweenDuration("Funky", 0.3f); }
public void touchDragOutsideAction(object sender, CCControlEvent controlEvent) { m_pDisplayValueLabel.Label = ("Drag Outside"); }
public void touchCancelAction(object sender, CCControlEvent controlEvent) { m_pDisplayValueLabel.Text = ("Touch Cancel"); }
public void touchUpOutsideAction(object sender, CCControlEvent controlEvent) { m_pDisplayValueLabel.Text = ("Touch Up Outside."); }
public void touchDragExitAction(object sender, CCControlEvent controlEvent) { m_pDisplayValueLabel.Text = ("Drag Exit"); }
public void onCCControlButtonWaveClicked(object pSender, CCControlEvent pCCControlEvent) { mAnimationManager.RunAnimations("Wave", 0.3f); }
public void onParticleSystemTestClicked(object pSender, CCControlEvent pCCControlEvent) { openTest("ccb/ccb/TestParticleSystems.ccbi", "TestParticleSystemsLayer", new Loader<ParticleSystemTestLayer>()); }
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); } } } }
public void onScrollViewTestClicked(object pSender, CCControlEvent pCCControlEvent) { openTest("ccb/ccb/TestScrollViews.ccbi", "TestScrollViewsLayer", new Loader<ScrollViewTestLayer>()); }
public CCInvocation(object target, SEL_CCControlHandler action, CCControlEvent controlEvent) { m_target = target; m_pAction = action; m_pControlEvent = controlEvent; }
public void onSpriteTestClicked(object pSender, CCControlEvent pCCControlEvent) { openTest("ccb/ccb/TestSprites.ccbi", "TestSpritesLayer", new Loader<SpriteTestLayer>()); }
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; }
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); }
public void onButtonTestClicked(object pSender, CCControlEvent pCCControlEvent) { openTest("ccb/ccb/TestButtons.ccbi", "TestButtonsLayer", new Loader <ButtonTestLayer>()); }
//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(); }
public void onSpriteTestClicked(object pSender, CCControlEvent pCCControlEvent) { openTest("ccb/ccb/TestSprites.ccbi", "TestSpritesLayer", new Loader <SpriteTestLayer>()); }
public CCInvocation(object target, Action <object, CCControlEvent> action, CCControlEvent controlEvent) { _target = target; _action = action; _controlEvent = controlEvent; }
public void onScrollViewTestClicked(object pSender, CCControlEvent pCCControlEvent) { openTest("ccb/ccb/TestScrollViews.ccbi", "TestScrollViewsLayer", new Loader <ScrollViewTestLayer>()); }
/** * 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)); } } }
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); }
public void onMenuTestClicked(object pSender, CCControlEvent pCCControlEvent) { openTest("ccb/ccb/TestMenus.ccbi", "TestMenusLayer", new Loader <MenuTestLayer>()); }
/** * 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); } } } }
public CCControlEventArgs(CCControlEvent controlEvent) { ControlEvent = controlEvent; }
/** * 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)); } } }
/** * 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)); } } }
public void touchDownAction(object sender, CCControlEvent controlEvent) { m_pDisplayValueLabel.Label = ("Touch Down"); }
/** * 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"); } }