ignoreContentAdaptWithSize】的更多相关文章

使用cocosStudio 中 的Text控件时,要设定text.ignoreContentAdaptWithSize(true); 设定控件(0.5,0.5)锚点位置不随文本长度变化而变化.…
作者:HU 转载请注明,原文链接:http://www.cnblogs.com/xioapingguo/p/4037414.html  虽然自从cocos2d-x更新到3.0后,使用freetype,并且增加了丰富文本,但这些文本都需要自己去设置,用起来也不方便,所以动手写了个简单html富文本 可以使用 <size=15></size>//字体大小 <fontname=“Arial”></fontname>//字体,这里必须有这个字体才能使用 <ou…
话不多说,直接上代码 --代码是lua的,c++也一样 local text = ccui.Text:create("text can line wrap text can line wrap text can line wrap text can line wrap text can line wrap", "Arial", 32) text:ignoreContentAdaptWithSize(false) --一定是要设置false text:setSize(…
近期试用了下cocos ide,然后引擎用的cocos2dx js 3 final,须要build runtime一下,以下是cocos studio相关的一些事件: 加入事件侦听: // button var root = ccs.uiReader.widgetFromJsonFile("res/UIButton_Editor/UIButton_Editor_1.json"); this.addChild(root); var back_label = ccui.helper.see…
从今天開始 咱也模仿 红孩儿这些大牛分析源代码 ,因为水平有限 不正确之处欢迎狂喷.哈哈. #ifndef __UIWIDGET_H__ #define __UIWIDGET_H__ #include "ui/CCProtectedNode.h" #include "ui/UILayoutDefine.h" #include "ui/UILayoutParameter.h" #include "ui/GUIDefine.h"…
var str1 = "兑换成功后,系统会生成“";var str2 = "红包兑换码";var str3 = "”,请复制该兑换码,并粘贴在";var str4 = "****游戏官方公众号";var str5 = "里,即可领取.";var rich1 = new ccui.RichElementText(11,cc.color(72,78,118),255,str1,"",36);…
-- 创建实现换行功能的文本 function LoadLabelHeroIntroduce(objLabelContent)  //传入文本 --------------------------------- local tLabel = LG.Label:create() --  实现换行功能      tLabel:ignoreContentAdaptWithSize(false) tLabel:setText(objLabelContent)    // 文本赋值 local tSize…
var dong = ccs.load("res/Login.json"); this.addChild(dong.node); this.cShamNotice = ccui.helper.seekWidgetByName(dong.node,"cShamNotice"); //字幕背景框 this.cShamNotice.setVisible(false); var str = "请各位玩家文明娱乐,远离赌博.如发现有赌博行为,将封停账号,并向xxxx…
理论基础 Widget类,所有UI控件的基类. 这类继承自ProtectedNode和LayoutParameterProtocol. 如果你想实现自己的UI控件,你应该继承这个类. 被 VideoPlayer, WebView, AbstractCheckButton, Button, EditBox, ImageView, Layout, LoadingBar, RadioButtonGroup, RichText, Slider, Text, TextAtlas, TextBMFont ,…
理论基础 显示图片的小控件,继承自 Widget . 代码实践 static ImageView * create()创建一个空的ImageView static ImageView * create(const std::string &imageFileName, //纹理的文件名字.TextureResType texType=TextureResType::LOCAL)根据图片名字创建一个ImageView. void loadTexture (const std::string &…