查看: 10375|回复: 18

[已经解决] 怎样在地图上显示变量的名称和数值

[复制链接]
梦石
0
星屑
50
在线时间
38 小时
注册时间
2009-11-30
回帖
46
发表于 2016-1-28 18:16:07 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
求大神帮忙指点一下,怎样在地图上显示几个个变量的名称和数值?谢谢,我在站里找到一个但是导入插件的时候提示Game_Interpreter未定义
https://raw.githubusercontent.co ... V/master/DWindow.js
rpg爱好者
梦石
0
星屑
50
在线时间
38 小时
注册时间
2009-11-30
回帖
46
 楼主| 发表于 2016-1-28 21:23:00 | 显示全部楼层
{:4_113:}{:4_113:}{:4_113:}{:4_113:}
rpg爱好者
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2016-1-28 22:16:58 | 显示全部楼层
本帖最后由 tseyik 于 2016-1-28 22:19 编辑

請配合同一作者的DTextPicture.js
// DTextPicture.js
// ----------------------------------------------------------------------------
// Copyright (c) 2015 Triacontane
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
// ----------------------------------------------------------------------------
// Version
// 1.2.0 2016/01/27 複数行表示に対応
//                  文字列の揃えと背景色を設定する機能を追加
//                  変数をゼロ埋めして表示する機能を追加
// 1.1.3 2015/12/10 戦闘画面でもピクチャを使用できるよう修正
//                  描画後にデバッグ画面等を開いて変数を修正した場合、再描画で変更が反映されてしまう問題を修正
// 1.1.2 2015/11/07 描画文字列に半角スペースが含まれていた場合も問題なく実行できるよう修正
// 1.1.0 2015/11/07 制御文字\C[n] \I[n] \{ \} に対応(\$と表示スピード制御系以外全部)
// 1.0.1 2015/11/07 RPGツクールMV(日本語版)に合わせてコメントの表記を変更
// 1.0.0 2015/11/06 初版
// ----------------------------------------------------------------------------
// [Blog]   : http://triacontane.blogspot.jp/
// [Twitter]: https://twitter.com/triacontane/
// [GitHub] : https://github.com/triacontane/
//=============================================================================

/*:
* @plugindesc 動的文字列ピクチャ生成プラグイン
* @author トリアコンタン
*
* @help 指定した文字列でピクチャを動的に生成するコマンドを提供します。
* 以下の手順で表示します。
*  1 : プラグインコマンド[D_TEXT]で描画したい文字列と引数を指定(下記の例参照)
*  2 : プラグインコマンド[D_TEXT_SETTING]で背景色や揃えを指定(任意)
*  3 : イベントコマンド「ピクチャの表示」で「画像」を未選択に指定。
* ※ 1の時点ではピクチャは表示されないので必ずセットで呼び出してください。
* ※ ピクチャ表示前にD_TEXTを複数回実行すると、複数行表示できます。
*
* プラグインコマンド詳細
*   イベントコマンド「プラグインコマンド」から実行。
*   (引数の間は半角スペースで区切る)
*
*  D_TEXT [描画文字列] [文字サイズ] : 動的文字列ピクチャ生成の準備
*  例:D_TEXT テスト文字列 32
*
* 表示後は通常のピクチャと同様に移動や回転、消去ができます。
* また、変数やアクターの表示など制御文字にも対応しています。
*
*  D_TEXT_SETTING ALIGN [揃え] : 揃え(左揃え、中央揃え、右揃え)の設定
*  0:左揃え 1:中央揃え 2:右揃え
*
*  例:D_TEXT_SETTING ALIGN 0
*      D_TEXT_SETTING ALIGN CENTER
*
*  D_TEXT_SETTING BG_COLOR [背景色] : 背景色の設定(CSSの色指定と同様の書式)
*
*  例:D_TEXT_SETTING BG_COLOR black
*      D_TEXT_SETTING BG_COLOR #336699
*      D_TEXT_SETTING BG_COLOR rgba(255,255,255,0.5)
*
* これらの設定はD_TEXTと同様、ピクチャを表示する前に行ってください。
*
* 対応制御文字一覧(イベントコマンド「文章の表示」と同一です)
* \V[n]
* \N[n]
* \P[n]
* \G
* \C[n]
* \I[n]
* \{
* \}
* \V[n,m](m桁分のゼロ埋め)

*
* 利用規約:
*  作者に無断で改変、再配布が可能で、利用形態(商用、18禁利用等)
*  についても制限はありません。
*  このプラグインはもうあなたのものです。
*/

评分

参与人数 1梦石 +1 收起 理由
余烬之中 + 1 认可答案

查看全部评分

回复

使用道具 举报

梦石
0
星屑
50
在线时间
38 小时
注册时间
2009-11-30
回帖
46
 楼主| 发表于 2016-1-28 22:24:38 | 显示全部楼层
tseyik 发表于 2016-1-28 22:16
請配合同一作者的DTextPicture.js
// DTextPicture.js
// ---------------------------------------------- ...

还是出错了,刚入门还不大会用,能麻烦帮我做一个范例吗?只要能在地图上显示几个变量名和数值的就行,感激不尽!
rpg爱好者
回复

使用道具 举报

梦石
0
星屑
50
在线时间
38 小时
注册时间
2009-11-30
回帖
46
 楼主| 发表于 2016-1-29 20:00:25 | 显示全部楼层
{:4_113:}{:4_113:}{:4_113:}
rpg爱好者
回复

使用道具 举报

梦石
0
星屑
50
在线时间
38 小时
注册时间
2009-11-30
回帖
46
 楼主| 发表于 2016-1-30 19:59:17 | 显示全部楼层
我貌似问了一个难题
rpg爱好者
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2016-1-30 20:48:41 | 显示全部楼层
13701225339 发表于 2016-1-30 19:59
我貌似问了一个难题

D-w+DText
Image002.png
回复

使用道具 举报

梦石
0
星屑
50
在线时间
38 小时
注册时间
2009-11-30
回帖
46
 楼主| 发表于 2016-1-31 10:53:01 | 显示全部楼层
tseyik 发表于 2016-1-30 20:48
D-w+DText

我按照一模一样的方法试了一下还是一点反应也没有啊。。。。。。。。。。。。。。是我哪里设置错了吗?我看那个D-TEXT插件里面的内容是空的,是那个原因吗?我复制的是这个https://raw.githubusercontent.co ... ter/DTextPicture.js
QQ截图20160131105018.jpg
QQ截图20160131104740.jpg
QQ截图20160131104820.jpg
QQ截图20160131104826.jpg
QQ截图20160131104834.jpg

点评

你可能没save成UTF-8  发表于 2016-1-31 11:58
rpg爱好者
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2016-1-31 11:53:37 | 显示全部楼层
13701225339 发表于 2016-1-31 10:53
我按照一模一样的方法试了一下还是一点反应也没有啊。。。。。。。。。。。。。。是我哪里设置错了吗?我 ...

DTextPicture.js
  1. //=============================================================================
  2. // DTextPicture.js
  3. // ----------------------------------------------------------------------------
  4. // Copyright (c) 2015 Triacontane
  5. // This software is released under the MIT License.
  6. // [url]http://opensource.org/licenses/mit-license.php[/url]
  7. // ----------------------------------------------------------------------------
  8. // Version
  9. // 1.2.1 2016/01/29 コマンド「D_TEXT_SETTING」の実装が「D_TEST_SETTING」になっていたので修正(笑)
  10. // 1.2.0 2016/01/27 複数行表示に対応
  11. //                  文字列の揃えと背景色を設定する機能を追加
  12. //                  変数をゼロ埋めして表示する機能を追加
  13. // 1.1.3 2015/12/10 戦闘画面でもピクチャを使用できるよう修正
  14. //                  描画後にデバッグ画面等を開いて変数を修正した場合、再描画で変更が反映されてしまう問題を修正
  15. // 1.1.2 2015/11/07 描画文字列に半角スペースが含まれていた場合も問題なく実行できるよう修正
  16. // 1.1.0 2015/11/07 制御文字\C[n] \I[n] \{ \} に対応(\$と表示スピード制御系以外全部)
  17. // 1.0.1 2015/11/07 RPGツクールMV(日本語版)に合わせてコメントの表記を変更
  18. // 1.0.0 2015/11/06 初版
  19. // ----------------------------------------------------------------------------
  20. // [Blog]   : [url]http://triacontane.blogspot.jp/[/url]
  21. // [Twitter]: [url]https://twitter.com/triacontane/[/url]
  22. // [GitHub] : [url]https://github.com/triacontane/[/url]
  23. //=============================================================================

  24. /*:
  25. * @plugindesc 動的文字列ピクチャ生成プラグイン
  26. * @author トリアコンタン
  27. *
  28. * @help 指定した文字列でピクチャを動的に生成するコマンドを提供します。
  29. * 以下の手順で表示します。
  30. *  1 : プラグインコマンド[D_TEXT]で描画したい文字列と引数を指定(下記の例参照)
  31. *  2 : プラグインコマンド[D_TEXT_SETTING]で背景色や揃えを指定(任意)
  32. *  3 : イベントコマンド「ピクチャの表示」で「画像」を未選択に指定。
  33. * ※ 1の時点ではピクチャは表示されないので必ずセットで呼び出してください。
  34. * ※ ピクチャ表示前にD_TEXTを複数回実行すると、複数行表示できます。
  35. *
  36. * プラグインコマンド詳細
  37. *   イベントコマンド「プラグインコマンド」から実行。
  38. *   (引数の間は半角スペースで区切る)
  39. *
  40. *  D_TEXT [描画文字列] [文字サイズ] : 動的文字列ピクチャ生成の準備
  41. *  例:D_TEXT テスト文字列 32
  42. *
  43. * 表示後は通常のピクチャと同様に移動や回転、消去ができます。
  44. * また、変数やアクターの表示など制御文字にも対応しています。
  45. *
  46. *  D_TEXT_SETTING ALIGN [揃え] : 揃え(左揃え、中央揃え、右揃え)の設定
  47. *  0:左揃え 1:中央揃え 2:右揃え
  48. *
  49. *  例:D_TEXT_SETTING ALIGN 0
  50. *      D_TEXT_SETTING ALIGN CENTER
  51. *
  52. *  D_TEXT_SETTING BG_COLOR [背景色] : 背景色の設定(CSSの色指定と同様の書式)
  53. *
  54. *  例:D_TEXT_SETTING BG_COLOR black
  55. *      D_TEXT_SETTING BG_COLOR #336699
  56. *      D_TEXT_SETTING BG_COLOR rgba(255,255,255,0.5)
  57. *
  58. * これらの設定はD_TEXTと同様、ピクチャを表示する前に行ってください。
  59. *
  60. * 対応制御文字一覧(イベントコマンド「文章の表示」と同一です)
  61. * \V[n]
  62. * \N[n]
  63. * \P[n]
  64. * \G
  65. * \C[n]
  66. * \I[n]
  67. * \{
  68. * \}
  69. * \V[n,m](m桁分のゼロ埋め)
  70. *
  71. * 利用規約:
  72. *  作者に無断で改変、再配布が可能で、利用形態(商用、18禁利用等)
  73. *  についても制限はありません。
  74. *  このプラグインはもうあなたのものです。
  75. */
  76. (function () {

  77.     var getCommandName = function (command) {
  78.         return (command || '').toUpperCase();
  79.     };

  80.     var getArgNumber = function (arg, min, max) {
  81.         if (arguments.length < 2) min = -Infinity;
  82.         if (arguments.length < 3) max = Infinity;
  83.         return (parseInt(convertEscapeCharacters(arg.toString()), 10) || 0).clamp(min, max);
  84.     };

  85.     var getArgString = function (arg, upperFlg) {
  86.         arg = convertEscapeCharacters(arg);
  87.         return upperFlg ? arg.toUpperCase() : arg;
  88.     };

  89.     var connectArgs = function (args, startIndex, endIndex) {
  90.         if (arguments.length < 2) startIndex = 0;
  91.         if (arguments.length < 3) endIndex = args.length;
  92.         var text = '';
  93.         for (var i = startIndex; i < endIndex; i++) {
  94.             text += args[i];
  95.             if (i < endIndex - 1) text += ' ';
  96.         }
  97.         return text;
  98.     };

  99.     var convertEscapeCharacters = function(text) {
  100.         if (text == null) text = '';
  101.         text = text.replace(/\\/g, '\x1b');
  102.         text = text.replace(/\x1b\x1b/g, '\\');
  103.         text = text.replace(/\x1bV\[(\d+)\,(\d+)\]/gi, function() {
  104.             return $gameVariables.value(parseInt(arguments[1])).padZero(arguments[2]);
  105.         }.bind(this));
  106.         var window = SceneManager.getHiddenWindow();
  107.         return window ? window.convertEscapeCharacters(text) : text;
  108.     };

  109.     SceneManager.getHiddenWindow = function() {
  110.         return this._scene._hiddenWindow;
  111.     };


  112.     //=============================================================================
  113.     // Game_Interpreter
  114.     //  プラグインコマンド[D_TEXT]を追加定義します。
  115.     //=============================================================================
  116.     var _Game_Interpreter_pluginCommand      = Game_Interpreter.prototype.pluginCommand;
  117.     Game_Interpreter.prototype.pluginCommand = function (command, args) {
  118.         _Game_Interpreter_pluginCommand.apply(this, arguments);
  119.         try {
  120.             this.pluginCommandDTextPicture(command, args);
  121.         } catch (e) {
  122.             if ($gameTemp.isPlaytest() && Utils.isNwjs()) {
  123.                 var window = require('nw.gui').Window.get();
  124.                 if (!window.isDevToolsOpen()) {
  125.                     var devTool = window.showDevTools();
  126.                     devTool.moveTo(0, 0);
  127.                     devTool.resizeTo(Graphics.width, Graphics.height);
  128.                     window.focus();
  129.                 }
  130.             }
  131.             console.log('プラグインコマンドの実行中にエラーが発生しました。');
  132.             console.log('- コマンド名  : ' + command);
  133.             console.log('- コマンド引数 : ' + args);
  134.             console.log('- エラー原因   : ' + e.toString());
  135.         }
  136.     };

  137.     Game_Interpreter.textAlignMapper = {
  138.         LEFT:0, CENTER:1, RIGHT:2, 左:0, 中央:1, 右:2
  139.     };

  140.     Game_Interpreter.prototype.pluginCommandDTextPicture = function(command, args) {
  141.         switch (getCommandName(command)) {
  142.             case 'D_TEXT' :
  143.                 if (isNaN(args[args.length - 1])) args.push($gameScreen.dTextSize || 28);
  144.                 var fontSize = getArgNumber(args.pop());
  145.                 $gameScreen.setDTextPicture(getArgString(connectArgs(args), false), fontSize);
  146.                 break;
  147.             case 'D_TEXT_SETTING':
  148.                 switch (getCommandName(args[0])) {
  149.                     case 'ALIGN' :
  150.                         $gameScreen.dTextAlign = isNaN(args[1]) ?
  151.                             Game_Interpreter.textAlignMapper[getArgString(args[1], true)] : getArgNumber(args[1], 0, 2);
  152.                         break;
  153.                     case 'BG_COLOR' :
  154.                         $gameScreen.dTextBackColor = getArgString(connectArgs(args, 1));
  155.                         break;
  156.                     case 'FONT':
  157.                         $gameScreen.setFont(getArgString(args[1]));
  158.                         break;
  159.                 }
  160.                 break;
  161.         }
  162.     };

  163.     //=============================================================================
  164.     // Game_Screen
  165.     //  動的ピクチャ用のプロパティを追加定義します。
  166.     //=============================================================================
  167.     var _Game_Screen_clear = Game_Screen.prototype.clear;
  168.     Game_Screen.prototype.clear = function() {
  169.         _Game_Screen_clear.call(this);
  170.         this.clearDTextPicture();
  171.     };

  172.     Game_Screen.prototype.clearDTextPicture = function() {
  173.         this.dTextValue = null;
  174.         this.dTextSize  = 0;
  175.         this.dTextAlign = 0;
  176.         this.dTextBackColor = null;
  177.         this.dTextFont = null;
  178.     };

  179.     Game_Screen.prototype.setDTextPicture = function(value, size) {
  180.         if (!this.dTextValue) this.dTextValue = [];
  181.         this.dTextValue.push(value);
  182.         this.dTextSize = size;
  183.     };

  184.     Game_Screen.prototype.getDTextPictureInfo = function() {
  185.         return {value:this.dTextValue, size:this.dTextSize, align:this.dTextAlign,
  186.             color:this.dTextBackColor, font:this.dTextFont};
  187.     };

  188.     Game_Screen.prototype.isSettingDText = function() {
  189.         return !!this.dTextValue;
  190.     };

  191.     Game_Screen.prototype.setFont = function(name) {
  192.         if (Graphics.isFontLoaded(name)) {
  193.             this.dTextFont = name;
  194.         }
  195.     };

  196.     //=============================================================================
  197.     // Game_Picture
  198.     //  動的ピクチャ用のプロパティを追加定義し、表示処理を動的ピクチャ対応に変更します。
  199.     //=============================================================================
  200.     var _Game_Picture_initBasic = Game_Picture.prototype.initBasic;
  201.     Game_Picture.prototype.initBasic = function() {
  202.         _Game_Picture_initBasic.call(this);
  203.         this.dTextValue = null;
  204.         this.dTextInfo = null;
  205.     };

  206.     var _Game_Picture_show = Game_Picture.prototype.show;
  207.     Game_Picture.prototype.show = function(name, origin, x, y, scaleX,
  208.                                            scaleY, opacity, blendMode) {
  209.         if ($gameScreen.isSettingDText()) {
  210.             arguments[0] = Date.now().toString();
  211.             var textValue = "";
  212.             this.dTextInfo = $gameScreen.getDTextPictureInfo();
  213.             this.dTextInfo.value.forEach(function(text) {
  214.                 textValue +=  text + '\n';
  215.             }.bind(this));
  216.             this.dTextInfo.value = textValue;
  217.         } else {
  218.             this.dTextInfo = null;
  219.         }
  220.         $gameScreen.clearDTextPicture();
  221.         _Game_Picture_show.apply(this, arguments);
  222.     };

  223.     //=============================================================================
  224.     // Sprite_Picture
  225.     //  画像の動的生成を追加定義します。
  226.     //=============================================================================
  227.     var _Sprite_Picture_loadBitmap = Sprite_Picture.prototype.loadBitmap;
  228.     Sprite_Picture.prototype.loadBitmap = function() {
  229.         this.dTextInfo = this.picture().dTextInfo;
  230.         if (this.dTextInfo) {
  231.             this.makeDynamicBitmap();
  232.         } else {
  233.             _Sprite_Picture_loadBitmap.call(this);
  234.         }
  235.     };

  236.     Sprite_Picture.prototype.makeDynamicBitmap = function() {
  237.         this.textWidths = [];
  238.         this.hiddenWindow = SceneManager.getHiddenWindow();
  239.         if (this.dTextInfo.font) this.hiddenWindow.contents.fontFace = this.dTextInfo.font;
  240.         if (this.dTextInfo.size > 0) this.hiddenWindow.contents.fontSize = this.dTextInfo.size;
  241.         var bitmapVirtual = new Bitmap_Virtual();
  242.         this._processText(bitmapVirtual);
  243.         this.bitmap = new Bitmap(bitmapVirtual.width, bitmapVirtual.height);
  244.         if (this.dTextInfo.font) this.bitmap.fontFace = this.dTextInfo.font;
  245.         if (this.dTextInfo.color) this.bitmap.fillAll(this.dTextInfo.color);
  246.         this._processText(this.bitmap);
  247.         this.hiddenWindow = null;
  248.     };

  249.     Sprite_Picture.prototype._processText = function(bitmap) {
  250.         var textState = {index: 0, x: 0, y: 0, text: this.dTextInfo.value, left:0, line:-1, height:0};
  251.         this._processNewLine(textState, bitmap);
  252.         textState.height = this.hiddenWindow.calcTextHeight(textState, false);
  253.         textState.index  = 0;
  254.         while (textState.text[textState.index]) {
  255.             this._processCharacter(textState, bitmap);
  256.         }
  257.     };

  258.     Sprite_Picture.prototype._processCharacter = function(textState, bitmap) {
  259.         if (textState.text[textState.index] === '\x1b') {
  260.             var code = this.hiddenWindow.obtainEscapeCode(textState);
  261.             switch (code) {
  262.                 case 'C':
  263.                     bitmap.textColor = this.hiddenWindow.textColor(this.hiddenWindow.obtainEscapeParam(textState));
  264.                     break;
  265.                 case 'I':
  266.                     this._processDrawIcon(this.hiddenWindow.obtainEscapeParam(textState), textState, bitmap);
  267.                     break;
  268.                 case '{':
  269.                     this.hiddenWindow.makeFontBigger();
  270.                     break;
  271.                 case '}':
  272.                     this.hiddenWindow.makeFontSmaller();
  273.                     break;
  274.                 case 'F':
  275.                     switch (this.hiddenWindow.obtainEscapeParam(textState)) {
  276.                         case 'I':
  277.                             bitmap.fontItalic = true;
  278.                             break;
  279.                         case '/':
  280.                         case 'N':
  281.                             bitmap.fontItalic = false;
  282.                             break;
  283.                     }
  284.                     break;
  285.             }
  286.         } else if (textState.text[textState.index] === '\n') {
  287.             this._processNewLine(textState, bitmap);
  288.         } else {
  289.             var c = textState.text[textState.index++];
  290.             var w = this.hiddenWindow.textWidth(c);
  291.             bitmap.fontSize = this.hiddenWindow.contents.fontSize;
  292.             bitmap.drawText(c, textState.x, textState.y, w * 2, textState.height, "left");
  293.             textState.x += w;
  294.         }
  295.     };

  296.     Sprite_Picture.prototype._processNewLine = function(textState, bitmap) {
  297.         if (bitmap instanceof Bitmap_Virtual)
  298.             this.textWidths[textState.line] = textState.x;
  299.         this.hiddenWindow.processNewLine(textState);
  300.         textState.line++;
  301.         if (bitmap instanceof Bitmap)
  302.             textState.x = (bitmap.width - this.textWidths[textState.line]) / 2 * this.dTextInfo.align;
  303.     };

  304.     Sprite_Picture.prototype._processDrawIcon = function(iconIndex, textState, bitmap) {
  305.         var iconBitmap = ImageManager.loadSystem('IconSet');
  306.         var pw = Window_Base._iconWidth;
  307.         var ph = Window_Base._iconHeight;
  308.         var sx = iconIndex % 16 * pw;
  309.         var sy = Math.floor(iconIndex / 16) * ph;
  310.         bitmap.blt(iconBitmap, sx, sy, pw, ph, textState.x + 2, textState.y + (textState.height - ph) / 2);
  311.         textState.x += Window_Base._iconWidth + 4;
  312.     };

  313.     //=============================================================================
  314.     // Scene_Map
  315.     //  動的ピクチャ作成用の隠しウィンドウを追加定義します。
  316.     //=============================================================================
  317.     var _Scene_Map_createDisplayObjects = Scene_Map.prototype.createDisplayObjects;
  318.     Scene_Map.prototype.createDisplayObjects = function() {
  319.         this._hiddenWindow = new Window_Base(1,1,1,1);
  320.         this._hiddenWindow.hide();
  321.         this._hiddenWindow.deactivate();
  322.         _Scene_Map_createDisplayObjects.call(this);
  323.         this.addChild(this._hiddenWindow);
  324.     };

  325.     //=============================================================================
  326.     // Scene_Battle
  327.     //  動的ピクチャ作成用の隠しウィンドウを追加定義します。
  328.     //=============================================================================
  329.     var _Scene_Battle_createDisplayObjects = Scene_Battle.prototype.createDisplayObjects;
  330.     Scene_Battle.prototype.createDisplayObjects = function() {
  331.         this._hiddenWindow = new Window_Base(1,1,1,1);
  332.         this._hiddenWindow.hide();
  333.         this._hiddenWindow.deactivate();
  334.         _Scene_Battle_createDisplayObjects.call(this);
  335.         this.addChild(this._hiddenWindow);
  336.     };

  337.     //=============================================================================
  338.     // Bitmap_Virtual
  339.     //  サイズを計算するための仮想ビットマップクラス
  340.     //=============================================================================
  341.     function Bitmap_Virtual() {
  342.         this.initialize.apply(this, arguments);
  343.     }

  344.     Bitmap_Virtual.prototype.initialize = function() {
  345.         this.window = SceneManager.getHiddenWindow();
  346.         this.width = 0;
  347.         this.height = 0;
  348.     };

  349.     Bitmap_Virtual.prototype.drawText = function(text, x, y, maxWidth, lineHeight, align) {
  350.         this.width  = Math.max(x + this.window.textWidth(text), this.width);
  351.         this.height = Math.max(y + this.window.contents.fontSize + 8, this.height);
  352.     };

  353.     Bitmap_Virtual.prototype.blt = function(source, sx, sy, sw, sh, dx, dy, dw, dh) {
  354.         this.width  = Math.max(dx + (dw || sw), this.width);
  355.         this.height = Math.max(dy + (dy || sy), this.height);
  356.     };
  357. })();
复制代码
回复

使用道具 举报

梦石
0
星屑
50
在线时间
38 小时
注册时间
2009-11-30
回帖
46
 楼主| 发表于 2016-1-31 14:48:36 | 显示全部楼层
tseyik 发表于 2016-1-31 11:53
[fold=DTextPicture.js]//========================================================================== ...

直接把你给的这段替换进去,结果还和之前的一样。。。我把这个转换成UTF-8又试了一下还是不行。。不能显示文字,起码也得显示个窗口啊,然而什么反应都没有
rpg爱好者
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部