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

C# CCVerticalTextAlignment类代码示例

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

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



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

示例1: CreateNativeLabel

        internal static CCTexture2D CreateNativeLabel(string text, CCSize dimensions, CCTextAlignment hAlignment,
		                                   CCVerticalTextAlignment vAlignment, string fontName,
		                                   float fontSize, CCColor4B textColor)
		{

		    if (string.IsNullOrEmpty(text))
		    {
		        return new CCTexture2D();
		    }

		    var font = CreateFont (fontName, fontSize);

            if (dimensions.Equals(CCSize.Zero))
            {
                CreateBitmap(1, 1);

                var ms = _graphics.MeasureString(text, font);
                
                dimensions.Width = ms.Width;
                dimensions.Height = ms.Height;
            }

            CreateBitmap((int)dimensions.Width, (int)dimensions.Height);

            var stringFormat = new StringFormat();

		    switch (hAlignment)
		    {
		        case CCTextAlignment.Left:
                    stringFormat.Alignment = StringAlignment.Near;
		            break;
		        case CCTextAlignment.Center:
                    stringFormat.Alignment = StringAlignment.Center;
		            break;
		        case CCTextAlignment.Right:
                    stringFormat.Alignment = StringAlignment.Far;
		            break;
		    }

		    switch (vAlignment)
		    {
		        case CCVerticalTextAlignment.Top:
        		    stringFormat.LineAlignment = StringAlignment.Near;
		            break;
		        case CCVerticalTextAlignment.Center:
        		    stringFormat.LineAlignment = StringAlignment.Center;
		            break;
		        case CCVerticalTextAlignment.Bottom:
        		    stringFormat.LineAlignment = StringAlignment.Far;
		            break;
		    }

            _graphics.DrawString(text, font, _brush, new RectangleF(0, 0, dimensions.Width, dimensions.Height), stringFormat);
            _graphics.Flush();

			var texture = new CCTexture2D();
			texture.InitWithStream (SaveToStream(), Microsoft.Xna.Framework.Graphics.SurfaceFormat.Bgra4444);

			return texture;
		}
开发者ID:Karunp,项目名称:cocos2d-xna,代码行数:60,代码来源:CCLabelUtilities-Gdi.cs


示例2: CCTextFieldTTF

 public CCTextFieldTTF(string text, string fontName, float fontSize, CCSize dimensions, CCTextAlignment hAlignment, CCVerticalTextAlignment vAlignment)
     : base(text, fontName, fontSize, dimensions, new CCLabelFormat( CCLabelFormatFlags.Unknown ) { Alignment = hAlignment,
         LineAlignment = vAlignment})
 {
     EditTitle = "Input";
     EditDescription = "Please provide input";
 }
开发者ID:ToraiRei,项目名称:cozy,代码行数:7,代码来源:CCTextFieldTTF.cs


示例3: CCLabelTTF

        public CCLabelTTF ()
        {
            m_hAlignment = CCTextAlignment.Center;
            m_vAlignment = CCVerticalTextAlignment.Top;
            m_pFontName = string.Empty;
            m_fFontSize = 0.0f;

            Init();
        }
开发者ID:huaqiangs,项目名称:cocos2d-xna,代码行数:9,代码来源:CCLabelTTF.cs


示例4: OnEnter

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

            var s = VisibleBoundsWorldspace.Size;

            menuLeft.Position = new CCPoint(50, s.Height / 2 - 20);
            menuRight.Position = new CCPoint(s.Width - 50, s.Height / 2 - 20);


            alignmentLabel = null;
            horizontalAlign = CCTextAlignment.Left;
            verticalAlign = CCVerticalTextAlignment.Top;


            blockSize = new CCSize(s.Width / 3, s.Height / 2);

            var leftPanel = new AlignmentPanel(blockSize, new CCColor4B(100, 100, 100, 255));
            var centerPanel = new AlignmentPanel(blockSize, new CCColor4B(200, 100, 100, 255));
            var rightPanel = new AlignmentPanel(blockSize, new CCColor4B(100, 100, 200, 255));

            leftPanel.IgnoreAnchorPointForPosition = false;
            centerPanel.IgnoreAnchorPointForPosition = false;
            rightPanel.IgnoreAnchorPointForPosition = false;

            leftPanel.AnchorPoint = CCPoint.AnchorMiddleLeft;
            centerPanel.AnchorPoint = CCPoint.AnchorMiddleLeft;
            rightPanel.AnchorPoint = CCPoint.AnchorMiddleLeft;

            leftPanel.Position = new CCPoint(0, s.Height / 2);
            centerPanel.Position = new CCPoint(blockSize.Width, s.Height / 2);
            rightPanel.Position = new CCPoint(blockSize.Width * 2, s.Height / 2);

            AddChild(leftPanel, -1);
            AddChild(rightPanel, -1);
            AddChild(centerPanel, -1);

            updateAlignment();
        }
开发者ID:KevinHeyer,项目名称:CocosSharp,代码行数:39,代码来源:LabelSystemFontAlignmentTest.cs


示例5: LabelTTFTest

        public LabelTTFTest()
        {
            var blockSize = new CCSize(200, 160);
			var s = Layer.VisibleBoundsWorldspace.Size;

			var colorLayer = new CCLayerColor(new CCColor4B(100, 100, 100, 255));
			colorLayer.AnchorPoint = CCPoint.Zero;
            colorLayer.Position = new CCPoint((s.Width - blockSize.Width) / 2, (s.Height - blockSize.Height) / 2);

            AddChild(colorLayer);

			CCMenuItemFont.FontSize = 32;
			CCMenuItemFont.FontName = "MarkerFelt";

			var menu = new CCMenu(
				new CCMenuItemFont("Left", setAlignmentLeft),
				new CCMenuItemFont("Center", setAlignmentCenter),
				new CCMenuItemFont("Right", setAlignmentRight)
                );
            menu.AlignItemsVertically(4);
            menu.Position = new CCPoint(50, s.Height / 2 - 20);
            AddChild(menu);

            menu = new CCMenu(
				new CCMenuItemFont("Top", setAlignmentTop),
				new CCMenuItemFont("Middle", setAlignmentMiddle),
				new CCMenuItemFont("Bottom", setAlignmentBottom)
                );
            menu.AlignItemsVertically(4);
            menu.Position = new CCPoint(s.Width - 50, s.Height / 2 - 20);
            AddChild(menu);

            m_plabel = null;
            m_eHorizAlign = CCTextAlignment.Left;
            m_eVertAlign = CCVerticalTextAlignment.Top;

            updateAlignment();
        }
开发者ID:netonjm,项目名称:CocosSharp,代码行数:38,代码来源:LabelTTFTest.cs


示例6: LabelTTFTest

        public LabelTTFTest()
        {
            var blockSize = new CCSize(200, 160);
            CCSize s = CCDirector.SharedDirector.WinSize;

            CCLayerColor colorLayer = new CCLayerColor(new CCColor4B(100, 100, 100, 255), blockSize.Width, blockSize.Height);
            colorLayer.AnchorPoint = new CCPoint(0, 0);
            colorLayer.Position = new CCPoint((s.Width - blockSize.Width) / 2, (s.Height - blockSize.Height) / 2);

            AddChild(colorLayer);

            CCMenuItemFont.FontSize = 30;
            CCMenu menu = new CCMenu(
                new CCMenuItemFont("Left", setAlignmentLeft),
                new CCMenuItemFont("Center", setAlignmentCenter),
                new CCMenuItemFont("Right", setAlignmentRight)
                );
            menu.AlignItemsVerticallyWithPadding(4);
            menu.Position = new CCPoint(50, s.Height / 2 - 20);
            AddChild(menu);

            menu = new CCMenu(
                new CCMenuItemFont("Top", setAlignmentTop),
                new CCMenuItemFont("Middle", setAlignmentMiddle),
                new CCMenuItemFont("Bottom", setAlignmentBottom)
                );
            menu.AlignItemsVerticallyWithPadding(4);
            menu.Position = new CCPoint(s.Width - 50, s.Height / 2 - 20);
            AddChild(menu);

            m_plabel = null;
            m_eHorizAlign = CCTextAlignment.CCTextAlignmentLeft;
            m_eVertAlign = CCVerticalTextAlignment.CCVerticalTextAlignmentTop;

            updateAlignment();
        }
开发者ID:CartBlanche,项目名称:cocos2d-xna,代码行数:36,代码来源:LabelTTFTest.cs


示例7: CCTextField

        public CCTextField(string text, string fontName, float fontSize, CCSize dimensions, CCTextAlignment hAlignment, CCVerticalTextAlignment vAlignment, CCLabelFormat labelFormat)
            : base(text, fontName, fontSize, dimensions, labelFormat)
        {
            this.HorizontalAlignment = hAlignment;
            this.VerticalAlignment = vAlignment;
            AutoRepeat = true;
            placeHolderText = text;
            updateColors();
            TextFieldIMEImplementation = IMEKeyboardImpl.SharedInstance;

        }
开发者ID:ToraiRei,项目名称:cozy,代码行数:11,代码来源:CCTextField.cs


示例8: CCLabelBMFont

 public CCLabelBMFont(string str, string fntFile, CCSize dimensions, CCTextAlignment hAlignment, CCVerticalTextAlignment vAlignment,
     CCPoint imageOffset, CCTexture2D texture)
 {
     InitCCLabelBMFont(str, fntFile, dimensions, hAlignment, vAlignment, imageOffset, texture);
 }
开发者ID:KevinHeyer,项目名称:CocosSharp,代码行数:5,代码来源:CCLabelBMFont.cs


示例9: InitBMFont

        protected void InitBMFont(string theString, string fntFile, CCSize dimensions, CCTextAlignment hAlignment, CCVerticalTextAlignment vAlignment, 
            CCPoint imageOffset, CCTexture2D texture)
        {
            Debug.Assert(FontConfiguration == null, "re-init is no longer supported");
            Debug.Assert((theString == null && fntFile == null) || (theString != null && fntFile != null),
                "Invalid params for CCLabelBMFont");

            if (!String.IsNullOrEmpty(fntFile))
            {
                try
                {
                    FontAtlas = CCFontAtlasCache.GetFontAtlasFNT(fntFile, imageOffset);
                }
                catch {}

                if (FontAtlas == null)
                {
                    CCLog.Log("Bitmap Font CCLabel: Impossible to create font. Please check file: '{0}'", fntFile);
                    return;
                }

            }

            AnchorPoint = CCPoint.AnchorMiddle;

            FontConfiguration = CCBMFontConfiguration.FontConfigurationWithFile(fntFile);

            LabelType = CCLabelType.BitMapFont;

            if (String.IsNullOrEmpty(theString))
            {
                theString = String.Empty;
            }

            // Initialize the TextureAtlas along with children.
            var capacity = theString.Length;

            BlendFunc = CCBlendFunc.AlphaBlend;

            if (capacity == 0)
            {
                capacity = defaultSpriteBatchCapacity;
            }

            UpdateBlendFunc();

            // no lazy alloc in this node
            Children = new CCRawList<CCNode>(capacity);
            Descendants = new CCRawList<CCSprite>(capacity);

            this.labelDimensions = dimensions;

            horzAlignment = hAlignment;
            vertAlignment = vAlignment;

            IsOpacityCascaded = true;

            // We use base here so we do not trigger an update internally.
            base.ContentSize = CCSize.Zero;

            IsColorModifiedByOpacity = TextureAtlas.Texture.HasPremultipliedAlpha;
            AnchorPoint = CCPoint.AnchorMiddle;

            ImageOffset = imageOffset;

            Text = theString;
        }
开发者ID:haithemaraissia,项目名称:CocosSharp,代码行数:67,代码来源:CCLabel.cs


示例10: InitWithString

        protected virtual bool InitWithString(string theString, string fntFile, CCSize dimentions, CCTextAlignment hAlignment, CCVerticalTextAlignment vAlignment,
                                              CCPoint imageOffset, CCTexture2D texture)
        {
            Debug.Assert(m_pConfiguration == null, "re-init is no longer supported");
            Debug.Assert((theString == null && fntFile == null) || (theString != null && fntFile != null),
                         "Invalid params for CCLabelBMFont");

            if (!String.IsNullOrEmpty(fntFile))
            {
                CCBMFontConfiguration newConf = FNTConfigLoadFile(fntFile);
                if (newConf == null)
                {
                    CCLog.Log("CCLabelBMFont: Impossible to create font. Please check file: '{0}'", fntFile);
                    return false;
                }

                m_pConfiguration = newConf;

                m_sFntFile = fntFile;

                if (texture == null)
                {
                    try
                    {
                        texture = CCTextureCache.SharedTextureCache.AddImage(m_pConfiguration.AtlasName);
                    }
                    catch (Exception)
                    {
                        // Try the 'images' ref location just in case.
                        try
                        {
                            texture =
                                CCTextureCache.SharedTextureCache.AddImage(System.IO.Path.Combine("images",
                                                                                                  m_pConfiguration
                                                                                                      .AtlasName));
                        }
                        catch (Exception)
                        {
                            // Lastly, try <font_path>/images/<font_name>
                            string dir = System.IO.Path.GetDirectoryName(m_pConfiguration.AtlasName);
                            string fname = System.IO.Path.GetFileName(m_pConfiguration.AtlasName);
                            string newName = System.IO.Path.Combine(System.IO.Path.Combine(dir, "images"), fname);
                            texture = CCTextureCache.SharedTextureCache.AddImage(newName);
                        }
                    }
                }
            }
            else
            {
                texture = new CCTexture2D();
            }

            if (String.IsNullOrEmpty(theString))
            {
                theString = String.Empty;
            }

            if (base.InitWithTexture(texture, theString.Length))
            {
                m_tDimensions = dimentions;

                m_pHAlignment = hAlignment;
                m_pVAlignment = vAlignment;

                m_cDisplayedOpacity = m_cRealOpacity = 255;
                m_tDisplayedColor = m_tRealColor = CCTypes.CCWhite;
                m_bCascadeOpacityEnabled = true;
                m_bCascadeColorEnabled = true;

                m_obContentSize = CCSize.Zero;

                m_bIsOpacityModifyRGB = m_pobTextureAtlas.Texture.HasPremultipliedAlpha;
                AnchorPoint = new CCPoint(0.5f, 0.5f);

                m_tImageOffset = imageOffset;

                m_pReusedChar = new CCSprite();
                m_pReusedChar.InitWithTexture(m_pobTextureAtlas.Texture, CCRect.Zero, false);
                m_pReusedChar.BatchNode = this;

                SetString(theString, true);

                return true;
            }
            return false;
        }
开发者ID:huaqiangs,项目名称:cocos2d-xna,代码行数:86,代码来源:CCLabelBMFont.cs


示例11: CCLabelTTF

 public CCLabelTTF (string text, string fontName, float fontSize, CCSize dimensions, CCTextAlignment hAlignment,
                    CCVerticalTextAlignment vAlignment)
 {
     InitWithString(text, fontName, fontSize, dimensions, hAlignment, vAlignment);
 }
开发者ID:pekayatt,项目名称:cocos2d-xna,代码行数:5,代码来源:CCLabelTTF.cs


示例12: CCLabel

 public CCLabel(string text, string fontName, float fontSize, CCSize dimensions, CCTextAlignment hAlignment, CCVerticalTextAlignment vAlignment) 
 {
     // Can't call base(text, ...), becasue we have to initialize font first
     InitializeFont(fontName, fontSize, text);
     m_FontName = fontName;
     m_FontSize = fontSize;
     base.InitCCLabelBMFont(text, GetFontKey(fontName, fontSize), dimensions, hAlignment, vAlignment, CCPoint.Zero, m_pTexture);
 }
开发者ID:KerwinMa,项目名称:CocosSharp,代码行数:8,代码来源:CCLabel.cs


示例13: setAlignmentMiddle

 private void setAlignmentMiddle(object pSender)
 {
     m_eVertAlign = CCVerticalTextAlignment.CCVerticalTextAlignmentCenter;
     updateAlignment();
 }
开发者ID:CartBlanche,项目名称:cocos2d-xna,代码行数:5,代码来源:LabelTTFTest.cs


示例14: InitWithString

        protected virtual bool InitWithString(string text, string fontFile, CCSize dimentions, CCTextAlignment hAlignment, CCVerticalTextAlignment vAlignment, CCPoint imageOffset, CCTexture2D texture)
        {
            if (string.IsNullOrEmpty(fontFile) == false)
            {
                CCBMFontConfiguration newConfig = _fontConfigLoad(fontFile);
                if (newConfig == null)
                    return false;

                this._fontConfig = newConfig;
                //this._fontFile = fontFile;

                if (texture == null)
                {
                    //base.Texture = CCTextureCache.SharedTextureCache.AddImage(this._configuration.AtlasName);
                    texture = Factory.CreateTexture(this._fontConfig.AtlasName);
                }
            }
            else
            {
                texture = new CCTexture2D();
            }

            if (text == null) text = "";
            if (base.InitWithTexture(texture, text.Length))
            {
                this._dimensions = dimentions;
                this._horizontalAlignment = hAlignment;
                this._verticalAlignment = vAlignment;

                this._displayedOpacity = this._realOpacity = 255;
                this._displayedColor = this._realColor = CCTypes.CCWhite;
                this._isCascadeOpacityEnabled = true;
                this._isCascadeColorEnabled = true;
                base.ContentSize = CCSize.Zero;
                this._isOpacityModifyRGB = base.TextureAtlas.Texture.HasPremultipliedAlpha;
                this.AnchorPoint = new CCPoint(0.5f, 0.5f);
                this._imageOffset = imageOffset;
                this._reusedChar = new CCSprite();
                this._reusedChar.InitWithTexture(base.TextureAtlas.Texture, CCRect.Zero, false);
                this._reusedChar.BatchNode = this;
                this.SetString(text, true);
                return true;
            }
            return false;
        }
开发者ID:liwq-net,项目名称:UIFactory,代码行数:45,代码来源:XBMFont.cs


示例15: InitCCLabelTTF

        private void InitCCLabelTTF(string text, string fontName, float fontSize, 
            CCSize dimensions, CCTextAlignment hAlignment,
            CCVerticalTextAlignment vAlignment)
        {
            // shader program
            //this->setShaderProgram(CCShaderCache::sharedShaderCache()->programForKey(SHADER_PROGRAM));

            this.dimensions = new CCSize(dimensions.Width, dimensions.Height);
            horzTextAlignment = hAlignment;
            vertTextAlignment = vAlignment;
			if (fontName == null)
				fontName = "arial";
			this.fontName = (!string.IsNullOrEmpty(fontName.Trim())) ? fontName : "arial";
            this.fontSize = fontSize;

            this.Text = text;          
        }
开发者ID:KevinHeyer,项目名称:CocosSharp,代码行数:17,代码来源:CCLabelTtf.cs


示例16: InitWithString

        public bool InitWithString(string text, CCSize dimensions, CCTextAlignment hAlignment, CCVerticalTextAlignment vAlignment, string fontName,
                                   float fontSize)
        {
            try
            {
                m_CallParams = new object[] { text, dimensions, hAlignment, vAlignment, fontName, fontSize };

                // CCLog.Log("InitWithString: text={0}", text);

                Debug.Assert(dimensions.Width >= 0 || dimensions.Height >= 0);

                if (string.IsNullOrEmpty(text))
                {
                    return false;
                }

                SpriteFont font = m_spriteFont;

                if (font == null)
                {
                    font = CCSpriteFontCache.SharedInstance.GetFont(fontName, fontSize);
                    if (font == null)
                    {
                        CCLog.Log("Can't find {0}, use system default ({1})", fontName, DrawManager.DefaultFont);
                        font = CCSpriteFontCache.SharedInstance.GetFont(DrawManager.DefaultFont, fontSize);
                        if (font == null)
                        {
                            CCLog.Log("Failed to load default font. No font supported.");
                        }
                    }
                    // m_spriteFont = font;
                }

                if (font == null)
                    return (false);

                // m_spriteFont = font;

                if (dimensions.Equals(CCSize.Zero))
                {
                    Microsoft.Xna.Framework.Vector2 temp = font.MeasureString(text);
                    dimensions.Width = temp.X;
                    dimensions.Height = temp.Y;
                }

                //float scale = 1.0f;//need refer fontSize;

                var textList = new List<String>();
                var nextText = new StringBuilder();
                string[] lineList = text.Split('\n');

                float spaceWidth = font.MeasureString(" ").X;

                for (int j = 0; j < lineList.Length; ++j)
                {
                    string[] wordList = lineList[j].Split(' ');

                    float lineWidth = 0;
                    bool firstWord = true;
                    for (int i = 0; i < wordList.Length; ++i)
                    {
                        lineWidth += font.MeasureString(wordList[i]).X;

                        if (lineWidth > dimensions.Width)
                        {
                            lineWidth = 0;

                            if (nextText.Length > 0)
                            {
                                firstWord = true;
                                textList.Add(nextText.ToString());
            #if XBOX || XBOX360
                                nextText.Length = 0;
            #else
                        nextText.Clear();
            #endif
                            }
                            else
                            {
                                firstWord = false;
                                textList.Add(wordList[i]);
                                continue;
                            }
                        }

                        if (!firstWord)
                        {
                            nextText.Append(' ');
                            lineWidth += spaceWidth;
                        }

                        nextText.Append(wordList[i]);
                        firstWord = false;
                    }

                    textList.Add(nextText.ToString());
            #if XBOX || XBOX360
                    nextText.Length = 0;
            #else
                        nextText.Clear();
//.........这里部分代码省略.........
开发者ID:HarkDev,项目名称:cocos2d-xna,代码行数:101,代码来源:CCTexture2D.cs


示例17: InitCCLabelBMFont

        protected void InitCCLabelBMFont(string theString, string fntFile, CCSize dimensions, CCTextAlignment hAlignment, CCVerticalTextAlignment vAlignment,
            CCPoint imageOffset, CCTexture2D texture)
        {
            Debug.Assert(FontConfiguration == null, "re-init is no longer supported");
            Debug.Assert((theString == null && fntFile == null) || (theString != null && fntFile != null),
                "Invalid params for CCLabelBMFont");

            if (!String.IsNullOrEmpty(fntFile))
            {
                CCBMFontConfiguration newConf = FNTConfigLoadFile(fntFile);
                if (newConf == null)
                {
                    CCLog.Log("CCLabelBMFont: Impossible to create font. Please check file: '{0}'", fntFile);
                    return;
                }

                FontConfiguration = newConf;

                fntConfigFile = fntFile;

                if (texture == null)
                {
                    try
                    {
                        texture = CCTextureCache.SharedTextureCache.AddImage(FontConfiguration.AtlasName);
                    }
                    catch (Exception)
                    {
                        // Try the 'images' ref location just in case.
                        try
                        {
                            texture =
                                CCTextureCache.SharedTextureCache.AddImage(System.IO.Path.Combine("images",
                                    FontConfiguration
                                    .AtlasName));
                        }
                        catch (Exception)
                        {
                            // Lastly, try <font_path>/images/<font_name>
                            string dir = System.IO.Path.GetDirectoryName(FontConfiguration.AtlasName);
                            string fname = System.IO.Path.GetFileName(FontConfiguration.AtlasName);
                            string newName = System.IO.Path.Combine(System.IO.Path.Combine(dir, "images"), fname);
                            texture = CCTextureCache.SharedTextureCache.AddImage(newName);
                        }
                    }
                }
            }
            else
            {
                texture = new CCTexture2D();
            }

            if (String.IsNullOrEmpty(theString))
            {
                theString = String.Empty;
            }

            TextureAtlas = new CCTextureAtlas(texture, theString.Length);

            this.labelDimensions = dimensions;

            horzAlignment = hAlignment;
            vertAlignment = vAlignment;

            IsOpacityCascaded = true;

            ContentSize = CCSize.Zero;

            IsColorModifiedByOpacity = TextureAtlas.Texture.HasPremultipliedAlpha;
            AnchorPoint = CCPoint.AnchorMiddle;

            ImageOffset = imageOffset;

            SetString(theString, true);
        }
开发者ID:KevinHeyer,项目名称:CocosSharp,代码行数:75,代码来源:CCLabelBMFont.cs


示例18: setAlignmentTop

 private void setAlignmentTop(object pSender)
 {
     m_eVertAlign = CCVerticalTextAlignment.Top;
     updateAlignment();
 }
开发者ID:Karunp,项目名称:cocos2d-xna,代码行数:5,代码来源:LabelTTFTest.cs


示例19: init

		protected void init(string text, string fontName, float fontSize, Vector2 dimensions, CCTextAlignment hAlignment, CCVerticalTextAlignment vAlignment)
		{
			_opacityModifyRGB = true;
			_flipY = _flipX = false;
			_anchorPoint =  new Vector2(0.5f, 0.5f);
			_quadColor = new Color32 (255, 255, 255, 255);

			_hAlignment = CCTextAlignment.Center;
			_vAlignment = CCVerticalTextAlignment.Center;

			this.dimensions = dimensions;
			this.horizontalAlignment = hAlignment;
			this.verticalAlignment = vAlignment;
			this.fontName = getFontName(fontName);
			this.fontSize = fontSize;
			this.text = text;
		}
开发者ID:BigWoodGames,项目名称:cocos2d-unity,代码行数:17,代码来源:CCLabelTTF.cs


示例20: CCLabelTTF

		public CCLabelTTF(string text, string fontName, float fontSize, Vector2 dimensions, 
		                  CCTextAlignment hAlignment=CCTextAlignment.Left, 
		                  CCVerticalTextAlignment vAlignment=CCVerticalTextAlignment.Top)
		{
			init (text, fontName, fontSize, dimensions, hAlignment, vAlignment);
		}
开发者ID:BigWoodGames,项目名称:cocos2d-unity,代码行数:6,代码来源:CCLabelTTF.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# CEvent类代码示例发布时间:2022-05-24
下一篇:
C# CCVector2类代码示例发布时间: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