• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Cocos2D.CCColor3B类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Cocos2D.CCColor3B的典型用法代码示例。如果您正苦于以下问题:C# CCColor3B类的具体用法?C# CCColor3B怎么用?C# CCColor3B使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CCColor3B类属于Cocos2D命名空间,在下文中一共展示了CCColor3B类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GameOverLayer

        public GameOverLayer(int score, int remoteScore)
        {
            TouchEnabled = true;

            string scoreMessage = String.Format ("Game Over. You collected {0} bananas \r\n Opponent collected {1} bananas!", score, remoteScore);

            var scoreLabel = new CCLabelTTF (scoreMessage, "MarkerFelt", 22) {
                Position = new CCPoint( CCDirector.SharedDirector.WinSize.Center.X,  CCDirector.SharedDirector.WinSize.Center.Y + 50),
                Color = new CCColor3B (XNA.Color.Yellow)
            };

            AddChild (scoreLabel);

            var playAgainLabel = new CCLabelTTF ("Tap to Play Again", "MarkerFelt", 22) {
                Position = CCDirector.SharedDirector.WinSize.Center,
                Color = new CCColor3B (XNA.Color.Green)
            };

            AddChild (playAgainLabel);

            Color = new CCColor3B (XNA.Color.Black);
            Opacity = 255;
            // Clean up the room from the server
            if (Context.isRoomCreator) {
                WarpClient.GetInstance ().DeleteRoom (Context.gameRoomId);
            }
        }
开发者ID:nightsnaker,项目名称:XamarinMultiplayerBananas,代码行数:27,代码来源:GameOverLayer.cs


示例2: CreateScaledMenuItemLabel

        public static CCMenuItem CreateScaledMenuItemLabel(CCSize buttonSize, int labelPadding, float strokeSize, CCColor3B textColor, CCColor3B strokeColor, CCColor3B backColor, string labelText, Action action)
        {
            var menuItem = action != null ? new CCMenuItem(o => action()) : new CCMenuItem();

            var labelSize = new CCSize(buttonSize.Width - labelPadding, buttonSize.Height - labelPadding);

            // Add background
            var blockSprite = new CCSprite("images/Block_Back");
            blockSprite.ScaleTo(buttonSize);
            blockSprite.Color = backColor;

            menuItem.AddChild(blockSprite);
            menuItem.ContentSize = buttonSize;

            // Add label
            var labelTtf = new CCLabelTTF(labelText, "arial-24", 10);
            labelTtf.Color = textColor;

            // Add Stroke to label
            // if (strokeSize > 0) labelTtf.AddStroke(strokeSize, strokeColor);

            if (labelTtf.ContentSize.Width > labelSize.Width)
            {
                labelTtf.ScaleTo(labelSize);
            }

            menuItem.AddChild(labelTtf);

            return menuItem;
        }
开发者ID:Ratel13,项目名称:cocos2d-xna,代码行数:30,代码来源:MenuTestScene.cs


示例3: GameLayer

        public GameLayer()
        {
            TouchEnabled = true;

            localBananas = new List<CCSprite> ();

            localMonkey = new CCSprite ("MonkeyLocal");

            localMonkey.PositionY = 0;
            localMonkey.PositionX = CCDirector.SharedDirector.WinSize.Width / 2;
            AddChild (localMonkey);

            remoteMonkey = new CCSprite ("MonkeyRemote");
            remoteMonkey.PositionY = CCDirector.SharedDirector.WinSize.Height - remoteMonkey.ContentSizeInPixels.Height/2;
            remoteMonkey.PositionX = CCDirector.SharedDirector.WinSize.Width / 2;
            AddChild (remoteMonkey);

            if (!Context.isRoomCreator) {
                byte[] message = buildStartMessage ();
                sendWarpUpdate (message);
                beginLocalGame ();
            }

            Color = new CCColor3B (XNA.Color.ForestGreen);
            Opacity = 255;
        }
开发者ID:nightsnaker,项目名称:XamarinMultiplayerBananas,代码行数:26,代码来源:GameLayer.cs


示例4: InitWithDuration

 /// <summary>
 /// initializes the transition with a duration and with an RGB color 
 /// </summary>
 protected virtual bool InitWithDuration(float duration, CCScene scene, CCColor3B color)
 {
     if (base.InitWithDuration(duration, scene))
     {
         m_tColor = new CCColor4B {R = color.R, G = color.G, B = color.B, A = 0};
     }
     return true;
 }
开发者ID:Ratel13,项目名称:cocos2d-xna,代码行数:11,代码来源:CCTransitionFade.cs


示例5: InitWithLabel

 protected bool InitWithLabel(CCNode label, SEL_MenuHandler selector)
 {
     base.InitWithTarget(selector);
     m_fOriginalScale = 1.0f;
     m_tColorBackup = CCTypes.CCWhite;
     DisabledColor = new CCColor3B(126, 126, 126);
     Label = label;
     return true;
 }
开发者ID:CartBlanche,项目名称:cocos2d-xna,代码行数:9,代码来源:CCMenuItemLabel.cs


示例6: CCLayerColor

        //protected bool m_opacityChanged;

        public CCLayerColor()
        {
            m_cOpacity = 0;
            m_tColor = new CCColor3B(0, 0, 0);

            // default blend function
            m_tBlendFunc = new CCBlendFunc(CCMacros.CCDefaultSourceBlending, CCMacros.CCDefaultDestinationBlending);
            Init ();

        }
开发者ID:CartBlanche,项目名称:cocos2d-xna,代码行数:12,代码来源:CCLayerColor.cs


示例7: IntroLayer

        public IntroLayer()
        {
            // setup our color for the background
            Color = new CCColor3B(Microsoft.Xna.Framework.Color.Blue);
            Opacity = 255;

            CameraManager.Instance.Start(this);

            //this.addSprite();
            this.TouchEnabled = true;
            this.ScheduleUpdate();
        }
开发者ID:pekayatt,项目名称:cocos2dxna_intelPerC,代码行数:12,代码来源:IntroLayer.cs


示例8: InitWithLabel

		protected bool InitWithLabel(CCNode label, Action<object> selector)
        {
            base.InitWithTarget(selector);
            m_fOriginalScale = 1.0f;
            m_tColorBackup = CCTypes.CCWhite;
            DisabledColor = new CCColor3B(126, 126, 126);
            Label = label;

            CascadeColorEnabled = true;
            CascadeOpacityEnabled = true;

            return true;
        }
开发者ID:pekayatt,项目名称:cocos2d-xna,代码行数:13,代码来源:CCMenuItemLabel.cs


示例9: GameStartLayer

        public GameStartLayer()
        {
            TouchEnabled = true;

            statusLabel = new CCLabelTTF (status, "MarkerFelt", 22) {
                Position = CCDirector.SharedDirector.WinSize.Center,
                Color = new CCColor3B (XNA.Color.Yellow)
            };

            AddChild(statusLabel);

            Color = new CCColor3B (XNA.Color.ForestGreen);
            Opacity = 255;
        }
开发者ID:nightsnaker,项目名称:XamarinMultiplayerBananas,代码行数:14,代码来源:GameStartLayer.cs


示例10: SetColor

        public void SetColor(CCColor3B colorValue)
        {
            // XXX fixed me if not correct
            base.Color = colorValue;

            RGBA rgba;
            rgba.r = colorValue.R / 255.0f;
            rgba.g = colorValue.G / 255.0f;
            rgba.b = colorValue.B / 255.0f;
            rgba.a = 1.0f;

            _hsv = CCControlUtils.HSVfromRGB(rgba);
            UpdateHueAndControlPicker();
        }
开发者ID:Ratel13,项目名称:cocos2d-xna,代码行数:14,代码来源:CCControlColourPicker.cs


示例11: IntroLayer

        public IntroLayer()
        {
            // create and initialize a Label
            var label = new CCLabelTTF("Hello Cocos2D-XNA", "MarkerFelt", 22);

            // position the label on the center of the screen
            label.Position = CCDirector.SharedDirector.WinSize.Center;

            // add the label as a child to this Layer
            AddChild(label);

            // setup our color for the background
            Color = new CCColor3B(Microsoft.Xna.Framework.Color.Blue);
            Opacity = 255;
        }
开发者ID:koboldul,项目名称:Cocos2DGame1,代码行数:15,代码来源:IntroLayer.cs


示例12: IntroLayer

		public IntroLayer () 
		{

			// create and initialize a Label
			var label = new CCLabelTTF("Intro Layer", "MarkerFelt", 22);

			// position the label on the center of the screen
			label.Position = CCDirector.SharedDirector.WinSize.Center;

			// add the label as a child to this Layer
			AddChild(label);

			// setup our color for the background
			Color = new CCColor3B (Microsoft.Xna.Framework.Color.Blue);
			Opacity = 255;

			// Wait a little and then transition to the new scene
			ScheduleOnce (TransitionOut, 2);
		}
开发者ID:Ratel13,项目名称:cocos2d-xna,代码行数:19,代码来源:IntroLayer.cs


示例13: Create

 public static CCMotionStreak Create(float fade, float minSeg, float stroke, CCColor3B color, string path)
 {
     var pRet = new CCMotionStreak();
     pRet.InitWithFade(fade, minSeg, stroke, color, path);
     return pRet;
 }
开发者ID:CartBlanche,项目名称:cocos2d-xna,代码行数:6,代码来源:CCMotionStreak.cs


示例14: TintWithColor

        public void TintWithColor(CCColor3B colors)
        {
            Color = colors;

            for (int i = 0; i < m_uNuPoints * 2; i++)
            {
                m_pVertices[i].Colors = new CCColor4B(colors.R, colors.G, colors.B, 255);
            }
        }
开发者ID:CartBlanche,项目名称:cocos2d-xna,代码行数:9,代码来源:CCMotionStreak.cs


示例15: InitWithFade

        public bool InitWithFade(float fade, float minSeg, float stroke, CCColor3B color, CCTexture2D texture)
        {
            Position = CCPoint.Zero;
            AnchorPoint = CCPoint.Zero;
            IgnoreAnchorPointForPosition = true;
            m_bStartingPositionInitialized = false;

            m_tPositionR = CCPoint.Zero;
            m_bFastMode = true;
            m_fMinSeg = (minSeg == -1.0f) ? stroke / 5.0f : minSeg;
            m_fMinSeg *= m_fMinSeg;

            m_fStroke = stroke;
            m_fFadeDelta = 1.0f / fade;

            m_uMaxPoints = (int) (fade * 60.0f) + 2;
            m_uNuPoints = 0;
            m_pPointState = new float[m_uMaxPoints];
            m_pPointVertexes = new CCPoint[m_uMaxPoints];

            m_pVertices = new CCV3F_C4B_T2F[(m_uMaxPoints + 1) * 2];

            // Set blend mode
            m_tBlendFunc.Source = CCOGLES.GL_SRC_ALPHA;
            m_tBlendFunc.Destination = CCOGLES.GL_ONE_MINUS_SRC_ALPHA;

            // shader program
            // setShaderProgram(CCShaderCache.sharedShaderCache().programForKey(kCCShader_PositionTextureColor));

            Texture = texture;
            Color = color;
            ScheduleUpdate();

            return true;
        }
开发者ID:CartBlanche,项目名称:cocos2d-xna,代码行数:35,代码来源:CCMotionStreak.cs


示例16: TintMe

		void TintMe(CCColor3B theColor)
		{
			
			someSprite.Color = theColor;
			
		}
开发者ID:alegogit,项目名称:AngryNinjas,代码行数:6,代码来源:CustomAnimation.cs


示例17: UpdateDisplayedColor

        public virtual void UpdateDisplayedColor(CCColor3B parentColor)
        {
            _displayedColor.R = (byte) (_realColor.R * parentColor.R / 255.0f);
            _displayedColor.G = (byte) (_realColor.G * parentColor.G / 255.0f);
            _displayedColor.B = (byte) (_realColor.B * parentColor.B / 255.0f);

            if (_cascadeColorEnabled)
            {
                if (_cascadeOpacityEnabled && m_pChildren != null)
                {
                    for (int i = 0, count = m_pChildren.count; i < count; i++)
                    {
                        var item = m_pChildren.Elements[i] as ICCRGBAProtocol;
                        if (item != null)
                        {
                            item.UpdateDisplayedColor(_displayedColor);
                        }
                    }
                }
            }
        }
开发者ID:Ratel13,项目名称:cocos2d-xna,代码行数:21,代码来源:CCNodeRGBA.cs


示例18: ReadKeyframe

        private CCBKeyframe ReadKeyframe(CCBPropertyType type)
        {
            var keyframe = new CCBKeyframe();

            keyframe.Time = ReadFloat();

            var easingType = (CCBEasingType) ReadInt(false);
            float easingOpt = 0;
            object value = null;

            if (easingType == CCBEasingType.CubicIn
                || easingType == CCBEasingType.CubicOut
                || easingType == CCBEasingType.CubicInOut
                || easingType == CCBEasingType.ElasticIn
                || easingType == CCBEasingType.ElasticOut
                || easingType == CCBEasingType.ElasticInOut)
            {
                easingOpt = ReadFloat();
            }
            keyframe.EasingType = easingType;
            keyframe.EasingOpt = easingOpt;

            if (type == CCBPropertyType.Check)
            {
                value = new CCBValue(ReadBool());
            }
            else if (type == CCBPropertyType.Byte)
            {
                value = new CCBValue(ReadByte());
            }
            else if (type == CCBPropertyType.Color3)
            {
                byte r = ReadByte();
                byte g = ReadByte();
                byte b = ReadByte();

                var c = new CCColor3B(r, g, b);
                value = new CCColor3BWapper(c);
            }
            else if (type == CCBPropertyType.Degrees)
            {
                value = new CCBValue(ReadFloat());
            }
            else if (type == CCBPropertyType.ScaleLock || type == CCBPropertyType.Position || type == CCBPropertyType.FloatXY)
            {
                float a = ReadFloat();
                float b = ReadFloat();

                value = new List<CCBValue>
                    {
                        new CCBValue(a),
                        new CCBValue(b)
                    };
            }
            else if (type == CCBPropertyType.SpriteFrame)
            {
                string spriteSheet = ReadCachedString();
                string spriteFile = ReadCachedString();

                CCSpriteFrame spriteFrame;

                if (String.IsNullOrEmpty(spriteSheet))
                {
                    spriteFile = _CCBRootPath + spriteFile;

                    CCTexture2D texture = CCTextureCache.SharedTextureCache.AddImage(CCFileUtils.RemoveExtension(spriteFile));
                    var bounds = new CCRect(0, 0, texture.ContentSize.Width, texture.ContentSize.Height);
                    spriteFrame = new CCSpriteFrame(texture, bounds);
                }
                else
                {
                    spriteSheet = _CCBRootPath + spriteSheet;
                    CCSpriteFrameCache frameCache = CCSpriteFrameCache.SharedSpriteFrameCache;

                    // Load the sprite sheet only if it is not loaded            
                    if (!_loadedSpriteSheets.Contains(spriteSheet))
                    {
                        frameCache.AddSpriteFramesWithFile(spriteSheet);
                        _loadedSpriteSheets.Add(spriteSheet);
                    }

                    spriteFrame = frameCache.SpriteFrameByName(spriteFile);
                }
                value = spriteFrame;
            }

            keyframe.Value = value;

            return keyframe;
        }
开发者ID:womandroid,项目名称:cocos2d-xna,代码行数:90,代码来源:CCBReader.cs


示例19: CreateColor

 //! helper macro that creates an ccColor3B type
 static public CCColor3B CreateColor(byte r, byte g, byte b)
 {
     CCColor3B c = new CCColor3B(r, g, b);
     return c;
 }
开发者ID:CILP,项目名称:cocos2d-xna,代码行数:6,代码来源:ccTypes.cs


示例20: OnEnter

        public override void OnEnter()
        {
            base.OnEnter();

            Color = new CCColor3B(0, 0, 0);
            RemoveChild(m_background, true);
            m_background = null;

            m_emitter = new CCParticleSystemQuad();

            string filename = "Particles/" + m_title;
            m_emitter.InitWithFile(filename);
            AddChild(m_emitter, 10);

            m_emitter.BlendAdditive = true;

            setEmitterPosition();
        }
开发者ID:Ratel13,项目名称:cocos2d-xna,代码行数:18,代码来源:ParticleTest.cs



注:本文中的Cocos2D.CCColor3B类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Cocos2D.CCColor4B类代码示例发布时间:2022-05-24
下一篇:
C# Cocos2D.CCBReader类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap