本文整理汇总了C#中CCControlEvent类的典型用法代码示例。如果您正苦于以下问题:C# CCControlEvent类的具体用法?C# CCControlEvent怎么用?C# CCControlEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CCControlEvent类属于命名空间,在下文中一共展示了CCControlEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: onAnimationsTestClicked
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));
}
示例2: valueChanged
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));
}
示例3: valueChanged
/* 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");
}
}
示例4: onCCControlButtonClicked
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;
}
}
示例5: SendActionsForControlEvents
/**
* 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);
}
}
}
}
示例6: ColourValueChanged
/** 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);
}
示例7: onCCControlButtonWaveClicked
public void onCCControlButtonWaveClicked(object pSender, CCControlEvent pCCControlEvent)
{
mAnimationManager.RunAnimations("Wave", 0.3f);
}
示例8: CCInvocation
public CCInvocation(object target, SEL_CCControlHandler action, CCControlEvent controlEvent)
{
m_target = target;
m_pAction = action;
m_pControlEvent = controlEvent;
}
示例9: onCCControlButtonFunkyClicked
public void onCCControlButtonFunkyClicked(object pSender, CCControlEvent pCCControlEvent)
{
mAnimationManager.RunAnimationsForSequenceNamedTweenDuration("Funky", 0.3f);
}
示例10: AddTargetWithActionForControlEvent
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);
}
示例11: HueSliderValueChanged
//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();
}
示例12: onSpriteTestClicked
public void onSpriteTestClicked(object pSender, CCControlEvent pCCControlEvent)
{
openTest("ccb/ccb/TestSprites.ccbi", "TestSpritesLayer", new Loader<SpriteTestLayer>());
}
示例13: CCInvocation
public CCInvocation(object target, Action<object, CCControlEvent> action, CCControlEvent controlEvent)
{
Target = target;
Action = action;
ControlEvent = controlEvent;
}
示例14: onParticleSystemTestClicked
public void onParticleSystemTestClicked(object pSender, CCControlEvent pCCControlEvent)
{
openTest("ccb/ccb/TestParticleSystems.ccbi", "TestParticleSystemsLayer", new Loader<ParticleSystemTestLayer>());
}
示例15: onScrollViewTestClicked
public void onScrollViewTestClicked(object pSender, CCControlEvent pCCControlEvent)
{
openTest("ccb/ccb/TestScrollViews.ccbi", "TestScrollViewsLayer", new Loader<ScrollViewTestLayer>());
}