制御文字が入った場所の特定ができず困っています。
とりあえず最初の行だけでもできればいいかなーと0,0にしてみたものが以下です。
コード: 全て選択
var _Window_Base_prototype_processEscapeCharacter = Window_Base.prototype.processEscapeCharacter;
Window_Base.prototype.processEscapeCharacter = function(code, textState) {
_Window_Base_prototype_processEscapeCharacter.call(this, code, textState);
switch (code) {
case 'B':
this.processBlackFillRect(this.obtainEscapeParam(textState), textState);
break;
}
};
Window_Base.prototype.processBlackFillRect = function(textState) {
var Width = this.contents.fontSize / 2 * textState + 4;
this.contents.paintOpacity = 64;
this.contents.fillRect(0, 0, Width, this.contents.fontSize + 4, this.textColor(15));
this.contents.paintOpacity = 255;
};
\B[8]と入力すると半角で8文字分の四角形が描画されるというものになります。
アイコンと同じでtextState.x + 2, textState.y + 2が使えると思っていたんですが使えず…
どうすれば制御文字が入力された位置を取得できるでしょうか?
せめて現在の行数だけでもわかると助かります。よろしくお願いします。