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


C# CCLabel.RepeatForever方法代码示例

本文整理汇总了C#中CocosSharp.CCLabel.RepeatForever方法的典型用法代码示例。如果您正苦于以下问题:C# CCLabel.RepeatForever方法的具体用法?C# CCLabel.RepeatForever怎么用?C# CCLabel.RepeatForever使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CocosSharp.CCLabel的用法示例。


在下文中一共展示了CCLabel.RepeatForever方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LabelSystemFontColorAndOpacity

        public LabelSystemFontColorAndOpacity()
        {
            m_time = 0;

            Color = new CCColor3B(128, 128, 128);
            Opacity = 255;

            label1 = new CCLabel("Label FadeOut/FadeIn", "fonts/Marker Felt.ttf", 40, CCLabelFormat.SystemFont)
                { 
                    Color = CCColor3B.Orange,
                    // testing anchors
                    AnchorPoint = CCPoint.AnchorLowerLeft
                };

            AddChild(label1, 0, (int)TagSprite.kTagBitmapAtlas1);

			var fade = new CCFadeOut  (1.0f);
			var fade_in = fade.Reverse();
			label1.RepeatForever ( fade, fade_in);

            label2 = new CCLabel("Label TintTo", "fonts/MorrisRoman-Black.ttf", 40, CCLabelFormat.SystemFont)                
                { 
                    Color = CCColor3B.Red,
                    // testing anchors
                    AnchorPoint = CCPoint.AnchorMiddle
                };

            AddChild(label2, 0, (int)TagSprite.kTagBitmapAtlas2);

			label2.RepeatForever( new CCTintTo (1, 255, 0, 0), new CCTintTo (1, 0, 255, 0), new CCTintTo (1, 0, 0, 255));

            label3 = new CCLabel("Label\nPlain\nBlue", "Helvetica", 40, CCLabelFormat.SystemFont)
                { 
                    Color = CCColor3B.Blue,
                    Opacity = 128,
                    // testing anchors
                    AnchorPoint = CCPoint.AnchorUpperRight
                };
            
             AddChild(label3, 0, (int)TagSprite.kTagBitmapAtlas3);

            //base.Schedule(step);
        }
开发者ID:KevinHeyer,项目名称:CocosSharp,代码行数:43,代码来源:LabelSystemFontColorAndOpacity.cs

示例2: LabelFNTColorAndOpacity

        public LabelFNTColorAndOpacity()
        {
            m_time = 0;

            Color = new CCColor3B(128, 128, 128);
            Opacity = 255;

			label1 = new CCLabel("Label1", "fonts/bitmapFontTest2.fnt");

            // testing anchors
			label1.AnchorPoint = CCPoint.AnchorLowerLeft;
            AddChild(label1, 0, (int)TagSprite.kTagBitmapAtlas1);

			var fade = new CCFadeOut  (1.0f);
			var fade_in = fade.Reverse();
			label1.RepeatForever ( fade, fade_in);


            // VERY IMPORTANT
            // color and opacity work OK because bitmapFontAltas2 loads a BMP image (not a PNG image)
            // If you want to use both opacity and color, it is recommended to use NON premultiplied images like BMP images
            // Of course, you can also tell XCode not to compress PNG images, but I think it doesn't work as expected
			label2 = new CCLabel("Label2", "fonts/bitmapFontTest2.fnt");
            // testing anchors
			label2.AnchorPoint = CCPoint.AnchorMiddle;
            label2.Color = CCColor3B.Red;
            AddChild(label2, 0, (int)TagSprite.kTagBitmapAtlas2);

			label2.RepeatForever( new CCTintTo (1, 255, 0, 0), new CCTintTo (1, 0, 255, 0), new CCTintTo (1, 0, 0, 255));

			label3 = new CCLabel("Label3", "fonts/bitmapFontTest2.fnt");
            // testing anchors
			label3.AnchorPoint = CCPoint.AnchorUpperRight;
            AddChild(label3, 0, (int)TagSprite.kTagBitmapAtlas3);

            base.Schedule(step);
        }
开发者ID:KevinHeyer,项目名称:CocosSharp,代码行数:37,代码来源:LabelFNTColorAndOpacity.cs

示例3: AddedToScene

        protected override void AddedToScene()
        {
            base.AddedToScene();

            var visibleRect = VisibleBoundsWorldspace;

            loading.Position = visibleRect.Center;

            LoadLabel((fntFNT) =>
                {
                    
                    label1 = new CCLabel(fntFNT, "Label1", CCSize.Zero, CCLabelFormat.BitMapFont);
                    AddChild(label1, 0, (int)TagSprite.kTagBitmapAtlas1);
                    //// testing anchors
                    label1.AnchorPoint = CCPoint.AnchorLowerLeft;
                    label1.Position = visibleRect.LeftBottom();

                    var fade = new CCFadeOut(1.0f);
                    var fade_in = fade.Reverse();
                    label1.RepeatForever(fade, fade_in);

                    // VERY IMPORTANT
                    // color and opacity work OK because bitmapFontAltas2 loads a BMP image (not a PNG image)
                    // If you want to use both opacity and color, it is recommended to use NON premultiplied images like BMP images
                    // Of course, you can also tell XCode not to compress PNG images, but I think it doesn't work as expected
                    label2 = new CCLabel(fntFNT, "Label2", CCSize.Zero, CCLabelFormat.BitMapFont);
                    // testing anchors
                    label2.AnchorPoint = CCPoint.AnchorMiddle;
                    label2.Color = CCColor3B.Red;
                    label2.Position = visibleRect.Center();
                    AddChild(label2, 0, (int)TagSprite.kTagBitmapAtlas2);

                    label2.RepeatForever(new CCTintTo(1, 255, 0, 0), new CCTintTo(1, 0, 255, 0), new CCTintTo(1, 0, 0, 255));

                    label3 = new CCLabel(fntFNT, "Label3", CCSize.Zero, CCLabelFormat.BitMapFont);
                    // testing anchors
                    label3.AnchorPoint = CCPoint.AnchorUpperRight;
                    label3.Position = visibleRect.RightTop();
                    AddChild(label3, 0, (int)TagSprite.kTagBitmapAtlas3);

                    loading.Visible = false;
                }
            );

        }
开发者ID:haithemaraissia,项目名称:CocosSharp,代码行数:45,代码来源:LabelFNTColorAndOpacity.cs


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