当前位置: 首页>>代码示例>>C#>>正文


C# Cocos2D.CCColor3B类代码示例

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


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


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