Cocos creator label text is too many and an error is reported
There are thousands of lines of legal entries such as user agreements and privacy terms
That’s what it said
let labelNode = new Node('labelNode')
let label = labelNode.addComponent(Label)
label.cacheMode = Label.CacheMode.CHAR
label.string = '....'
In this way, it can be loaded at once, and the protocol can be closed. When loading other protocols, an error of too long font size will be reported
After a long toss, the characters here are too long to keep the cache. Change the cachemode to none, but even none can’t load so much. Just write in several paragraphs
let a1 = ""
let a2 = ""
let a3 = ""
this.addLabel('a1', 0, a1)
this.addLabel('a2', -2000, a2)
this.addLabel('a3', -4000, a3)
addLabel(name:string, y: number, text:string){
let labelNode = new Node(name)
labelNode.layer = Layers.BitMask.UI_2D
labelNode.setPosition(0, y)
let label = labelNode.addComponent(Label)
label.cacheMode = Label.CacheMode.NONE
label.string = text
this.node.addChild(labelNode)
}
Read More:
- Cocos creator custom engine NPM Error [How to Fix]
- How to Solve cocos2dx msb3073 Error
- How to Solve cocos opens other items error
- How to Solve Nginx 413 Error (request entity too large)
- AUC Error – ValueError: Data is not binary and pos_label is not specified
- Error: env [NODE_ENV] is not set (How to Solve)
- [Solved] ES Query SIZE too large Error: ENTITY CONTENT IS TOO LONG [105539255] FOR THE CONFIGURED BUFFER LIMIT [104857600]
- How to Solve jQuery error: Uncaught ReferenceError: $ is not defined
- WordPress update failed 429 too many requests (How to Fix)
- How to Solve HBase error: region is not online
- How to Solve Error: “initializer element is not constant”
- How to Solve Maven Error: Return code is: 501 , ReasonPhrase:HTTPS Required.
- How to Solve “Error db.num is null” when starting Nacos
- How to Solve Error: homebrew-core is a shallow clone.
- How to Solve Error Swift 4 Expression type ‘@value CGRect’ is ambiguous without more context
- [Solved] Doris Error: Label Already Exists
- Cmake compile cocos2d-x error [How to Solve]
- How to Solve Pandas Error: nested renamer is not supported python
- How to Solve Element Error: target is not existed: .page-component__scroll .el-scrollbar__wrap
- Python Importerror: DLL load failed: the page file is too small to complete the operation.