- (function() {
- Window_Base.prototype.processEscapeCharacter = function(code, textState) {
- switch (code) {
- case 'C':
- this.changeTextColor(this.textColor(this.obtainEscapeParam(textState)));
- break;
- case 'I':
- this.processDrawIcon(this.obtainEscapeParam(textState), textState);
- break;
- case '{':
- this.makeFontBigger();
- break;
- case '}':
- this.makeFontSmaller();
- break;
- case '*':
- this.makeFontItalic();
- break;
- }
- };
- Window_Base.prototype.obtainEscapeCode = function(textState) {
- textState.index++;
- var regExp = /^[\\*\\$\\.\\|\\^!><\\{\\}\\\\]|^[A-Z]+/i;
- var arr = regExp.exec(textState.text.slice(textState.index));
- if (arr) {
- textState.index += arr[0].length;
- return arr[0].toUpperCase();
- } else {
- return '';
- }
- };
- Window_Base.prototype.makeFontItalic = function() {
- this.contents.fontItalic = (this.contents.fontItalic ? false : true);
- };
- })()
- //该片段来自于http://www.codesnippet.cn/detail/2211201615162.html
来源: http://www.codesnippet.cn/detail/2211201615162.html