# RichLabel **Repository Path**: reyn_gitee/RichLabel ## Basic Information - **Project Name**: RichLabel - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-12-13 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 富文本标签 --- RichLabel基于Cocos2dx+Lua v3.x 扩展标签极其简单,只需添加一个遵守规则的标签插件即可,无需改动已存在代码!! 如果不喜欢当前的富文本语法,也可以自己写标签解析器,只要转为指定的中间格式交给RichLabel处理即可!! [详细介绍](http://www.cnblogs.com/luweimy/p/4114449.html) | [中间格式参考标签解析器](https://github.com/Luweimy/labelparser) **特性:** * 支持标签定义富文本展示格式 * 支持图片(缩放,旋转,是否可见) * 支持文本属性(字体,大小,颜色,阴影,描边,发光) * 支持标签嵌套修饰文本,但是内部标签不会继承嵌套标签的属性 * 支持标签扩展(labels文件夹中可添加标签支持) * 支持渐入动画,动画逐字回调 * 支持设置最大宽度,自动换行布局 * 支持手动换行,使用'\n'换行 * 支持设置行间距,字符间距 * 支持添加debug绘制文字范围和锚点 * 支持获得文字的精灵节点 * 支持设置标签锚点,透明度,颜色... * 支持遍历字符,行等 * 支持获得任意行的行高 **标签支持:** `
world",
}
for i=1, #test_text do
local RichLabel = require("richlabel.RichLabel")
local label = RichLabel.new {
fontName = "res/msyh.ttf",
fontSize = 20,
fontColor = cc.c3b(255, 255, 255),
maxWidth=200,
lineSpace=0,
charSpace=0,
}
label:setString(test_text[i])
label:setPosition(cc.p(380,500-i*30))
label:playAnimation()
sceneGame:addChild(label)
label:debugDraw()
end
```
**基本接口:**
* setString - 设置要显示的富文本
* getSize - 获得Label的大小
*当前版本:v1.0.1*
v1.0.0 - 支持`