查看: 3006|回复: 2

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

[复制链接]
梦石
0
星屑
55
在线时间
84 小时
注册时间
2009-1-30
回帖
142
发表于 2016-8-21 01:04:56 | 显示全部楼层 |阅读模式

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

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

×
表示找不到相关类感觉无从下手。。。求指点QAQ
梦石
0
星屑
55
在线时间
84 小时
注册时间
2009-1-30
回帖
142
 楼主| 发表于 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指点感激不尽
[pre lang="javascript"]Scene_Map.prototype.start = function() {
    Scene_MenuBase.prototype.start.call(this);
    SceneManager.clearStack();
    if (this._transfer) {
        this.fadeInForTransfer();
        this._mapNameWindow.open();
        this._ningjingWindow.open();
        $gameMap.autoplay();
    } else if (this.needsFadeIn()) {
        this.startFadeIn(this.fadeSpeed(), false);
    }
    this.menuCalling = false;
};

Scene_Map.prototype.stop = function() {
    Scene_MenuBase.prototype.stop.call(this);
    $gamePlayer.straighten();
    this._mapNameWindow.close();
    this._ningjingWindow.close();
    if (this.needsSlowFadeOut()) {
        this.startFadeOut(this.slowFadeSpeed(), false);
    } else if (SceneManager.isNextScene(Scene_Map)) {
        this.fadeOutForTransfer();
    } else if (SceneManager.isNextScene(Scene_Battle)) {
        this.launchBattle();
    }
};
Scene_Map.prototype.terminate = function() {
    Scene_MenuBase.prototype.terminate.call(this);
    if (!SceneManager.isNextScene(Scene_Battle)) {
        this._spriteset.update();
        this._mapNameWindow.hide();
        this._ningjingWindow.hide();
        SceneManager.snapForBackground();
    }
    $gameScreen.clearZoom();
};
Scene_Map.prototype.createDisplayObjects = function() {
    this.createSpriteset();
    this.createMapNameWindow();
    this.createNingJingWindow();
    this.createWindowLayer();
    this.createAllWindows();
};
Scene_Map.prototype.createNingJingWindow = function(){
    this._ningjingWindow = new Window_Testing(580,580,220,40);
    this.addChild(this._ningjingWindow);
};

Scene_Map.prototype.callMenu = function() {
    SoundManager.playOk();
    SceneManager.push(Scene_Menu);
    Window_MenuCommand.initCommandPosition();
    $gameTemp.clearDestination();
    this._ningjingWindow.hide();
    this._mapNameWindow.hide();
    this._waitCount = 2;
};
Scene_Map.prototype.launchBattle = function() {
    BattleManager.saveBgmAndBgs();
    this.stopAudioOnBattleStart();
    SoundManager.playBattleStart();
    this.startEncounterEffect();
    this._ningjingWindow.hide();
    this._mapNameWindow.hide();
};

function Window_Testing() {
    this.initialize.apply(this, arguments);
}
Window_Testing.prototype = Object.create(Window_Base.prototype);
Window_Testing.prototype.initialize = function(x, y, width, height) {
    Window_Base.prototype.initialize.call(this, x, y, width, height);
    this.contents.fontSize = 24;
}

Window_Testing.prototype.standardPadding = function() {
    return 8;
};


Window_Testing.prototype.update = function() {
    Window_Base.prototype.update.call(this);
       
                var myDate = new Date();
       /*  if ($gameVariables.value(1)==0){
                $gameVariables._data[1]=1
                $gameVariables._data[2]=1
                $gameVariables._data[3]=1
                $gameVariables._data[4]=1
        }else if($gameVariables.value(5)>=4){
                $gameVariables._data[5]-=4
                $gameVariables._data[4]+=1
        }else if($gameVariables.value(4)>=25){
                $gameVariables._data[4]-=24
                $gameVariables._data[3]+=1
        }else if($gameVariables.value(3)>=31){
                $gameVariables._data[3]-=30
                $gameVariables._data[2]+=1
        }else if($gameVariables.value(2)>=13){
                $gameVariables._data[2]-=12
                $gameVariables._data[1]+=1
        } */
    var textW = 400;
    var textH = 0;
    this.contents.clear();
/*     this.drawText($gameVariables.value(1) + "Y", -180, -6, textW, 'right');
    textH += this.lineHeight();
    this.drawText($gameVariables.value(2) + "M", -130, -6, textW, 'right');
    textH += this.lineHeight();
    this.drawText($gameVariables.value(3) + "D", -80, -6, textW, 'right');
    textH += this.lineHeight(); */
    this.drawText(/* $gameVariables.value(4) */ /* myDate.getFullYear() + "年" + (myDate.getMonth() + 1) + "月" + myDate.getDate() + "日" */new Date() , 0, -6, textW, 'right');
    textH += this.lineHeight();
};
[/pre]
回复

使用道具 举报

梦石
0
星屑
55
在线时间
84 小时
注册时间
2009-1-30
回帖
142
 楼主| 发表于 2016-8-21 04:04:43 | 显示全部楼层
版主帮我和另一个帖合并下吧@余烬之中
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部