设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2447|回复: 2
打印 上一主题 下一主题

[已经过期] 问一下mv里如何获取系统时间

[复制链接]

Lv1.梦旅人

梦石
0
星屑
55
在线时间
84 小时
注册时间
2009-1-30
帖子
175
跳转到指定楼层
1
发表于 2016-8-21 01:04:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
表示找不到相关类感觉无从下手。。。求指点QAQ

Lv1.梦旅人

梦石
0
星屑
55
在线时间
84 小时
注册时间
2009-1-30
帖子
175
2
 楼主| 发表于 2016-8-21 04:03:45 | 只看该作者

连夜改了个实时显示系统时间脚本不知道如何格式化

脚步改自https://rpg.blue/forum.php?mod=viewthread&tid=393843
其中由于.getDay(); //获取当前星期X(0-6,0代表星期天),周日显示不知道如何把0变成日,尝试使用 if (myDate.getDay() == 0)       { myDate.getDay[1] = "日"}失败
求dalao指点感激不尽
JAVASCRIPT 代码复制
  1. Scene_Map.prototype.start = function() {
  2.     Scene_MenuBase.prototype.start.call(this);
  3.     SceneManager.clearStack();
  4.     if (this._transfer) {
  5.         this.fadeInForTransfer();
  6.         this._mapNameWindow.open();
  7.         this._ningjingWindow.open();
  8.         $gameMap.autoplay();
  9.     } else if (this.needsFadeIn()) {
  10.         this.startFadeIn(this.fadeSpeed(), false);
  11.     }
  12.     this.menuCalling = false;
  13. };
  14.  
  15. Scene_Map.prototype.stop = function() {
  16.     Scene_MenuBase.prototype.stop.call(this);
  17.     $gamePlayer.straighten();
  18.     this._mapNameWindow.close();
  19.     this._ningjingWindow.close();
  20.     if (this.needsSlowFadeOut()) {
  21.         this.startFadeOut(this.slowFadeSpeed(), false);
  22.     } else if (SceneManager.isNextScene(Scene_Map)) {
  23.         this.fadeOutForTransfer();
  24.     } else if (SceneManager.isNextScene(Scene_Battle)) {
  25.         this.launchBattle();
  26.     }
  27. };
  28. Scene_Map.prototype.terminate = function() {
  29.     Scene_MenuBase.prototype.terminate.call(this);
  30.     if (!SceneManager.isNextScene(Scene_Battle)) {
  31.         this._spriteset.update();
  32.         this._mapNameWindow.hide();
  33.         this._ningjingWindow.hide();
  34.         SceneManager.snapForBackground();
  35.     }
  36.     $gameScreen.clearZoom();
  37. };
  38. Scene_Map.prototype.createDisplayObjects = function() {
  39.     this.createSpriteset();
  40.     this.createMapNameWindow();
  41.     this.createNingJingWindow();
  42.     this.createWindowLayer();
  43.     this.createAllWindows();
  44. };
  45. Scene_Map.prototype.createNingJingWindow = function(){
  46.     this._ningjingWindow = new Window_Testing(580,580,220,40);
  47.     this.addChild(this._ningjingWindow);
  48. };
  49.  
  50. Scene_Map.prototype.callMenu = function() {
  51.     SoundManager.playOk();
  52.     SceneManager.push(Scene_Menu);
  53.     Window_MenuCommand.initCommandPosition();
  54.     $gameTemp.clearDestination();
  55.     this._ningjingWindow.hide();
  56.     this._mapNameWindow.hide();
  57.     this._waitCount = 2;
  58. };
  59. Scene_Map.prototype.launchBattle = function() {
  60.     BattleManager.saveBgmAndBgs();
  61.     this.stopAudioOnBattleStart();
  62.     SoundManager.playBattleStart();
  63.     this.startEncounterEffect();
  64.     this._ningjingWindow.hide();
  65.     this._mapNameWindow.hide();
  66. };
  67.  
  68. function Window_Testing() {
  69.     this.initialize.apply(this, arguments);
  70. }
  71. Window_Testing.prototype = Object.create(Window_Base.prototype);
  72. Window_Testing.prototype.initialize = function(x, y, width, height) {
  73.     Window_Base.prototype.initialize.call(this, x, y, width, height);
  74.     this.contents.fontSize = 24;
  75. }
  76.  
  77. Window_Testing.prototype.standardPadding = function() {
  78.     return 8;
  79. };
  80.  
  81.  
  82. Window_Testing.prototype.update = function() {
  83.     Window_Base.prototype.update.call(this);
  84.  
  85.                 var myDate = new Date();
  86.        /*  if ($gameVariables.value(1)==0){
  87.                 $gameVariables._data[1]=1
  88.                 $gameVariables._data[2]=1
  89.                 $gameVariables._data[3]=1
  90.                 $gameVariables._data[4]=1
  91.         }else if($gameVariables.value(5)>=4){
  92.                 $gameVariables._data[5]-=4
  93.                 $gameVariables._data[4]+=1
  94.         }else if($gameVariables.value(4)>=25){
  95.                 $gameVariables._data[4]-=24
  96.                 $gameVariables._data[3]+=1
  97.         }else if($gameVariables.value(3)>=31){
  98.                 $gameVariables._data[3]-=30
  99.                 $gameVariables._data[2]+=1
  100.         }else if($gameVariables.value(2)>=13){
  101.                 $gameVariables._data[2]-=12
  102.                 $gameVariables._data[1]+=1
  103.         } */
  104.     var textW = 400;
  105.     var textH = 0;
  106.     this.contents.clear();
  107. /*     this.drawText($gameVariables.value(1) + "Y", -180, -6, textW, 'right');
  108.     textH += this.lineHeight();
  109.     this.drawText($gameVariables.value(2) + "M", -130, -6, textW, 'right');
  110.     textH += this.lineHeight();
  111.     this.drawText($gameVariables.value(3) + "D", -80, -6, textW, 'right');
  112.     textH += this.lineHeight(); */
  113.     this.drawText(/* $gameVariables.value(4) */ /* myDate.getFullYear() + "年" + (myDate.getMonth() + 1) + "月" + myDate.getDate() + "日" */new Date() , 0, -6, textW, 'right');
  114.     textH += this.lineHeight();
  115. };

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
84 小时
注册时间
2009-1-30
帖子
175
3
 楼主| 发表于 2016-8-21 04:04:43 | 只看该作者
版主帮我和另一个帖合并下吧@余烬之中
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-17 07:25

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表