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:
- [Solved] pytorch CrossEntropyLoss Error: RuntimeError: 1D target tensor expected, multi-target not supported
- [Solved] Doris Error: Label Already Exists
- How to Solve cocos2dx msb3073 Error
- [Solved] Error in inherits(x, “theme”): argument “e2” is missing, with no default
- [Solved] TFrecords Create Datas Error: Number of int64 values != expected. Values size: 1 but output shape: [3]
- ElementUI Error in callback for watcher “data”: “Error: [ElTable] prop row-key is required”
- Solution to latex “too many unprocessed floats” error
- [Solved] Runtimeerror during dcgan training: found dtype long but expected float
- Vue require Error: node_modules/babel-loader/lib
- ‘pre-mature EOF‘ : syntax error syntax error [How to Solve]
- ValueError: Input 0 of node import/save/Assign was passed float from import/beta1_power:0 incompatib
- Cocos creator custom engine NPM Error [How to Fix]
- How to Solve mount error(6): No such device or address
- [Solved] MindSpore Error: “TypeError: parse() missing 1 required positional.”
- [Solved] jenkins-deleteDir Error (FilePath is missing)
- How to Solve ES error: “illegal_argument_exception”
- Qt Error: Debug Assertion Failed [How to Solve]
- [Solved] Github Push Codes Error: “error:RPC failed;curl 56 OpenSSL SSL_read:SSL_ERROR_SYSCALL,errno 10054”
- Implement base64_decode in GO language to solve the problem of illegal characters
- [Solved] Android Error: AAPT: error: unescaped apostrophe in string;Multiple substitutions specified in non-positi