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

Project1

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

[有事请教] 新建窗口,打开第一次有文字,第二次才有图片 这是???

[复制链接]

Lv1.梦旅人

梦石
0
星屑
145
在线时间
30 小时
注册时间
2010-7-28
帖子
10
跳转到指定楼层
1
发表于 2020-8-21 10:57:30 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
学着SIAKO.Mobi的教程 到创建一个基本窗口那一章。 最后的也是要第二次开才有角色图, 如何一打开就有角色图呢? 萌新求问

(function(){

//以别名填充菜单视窗方法
var screen_s = Scene_Menu.prototype.create;
Scene_Menu.prototype.create = function() {
        screen_s.call(this);
        this._cw = new Window_C();
        this._cw.y = 340;
        this.addWindow( this._cw );

};

//建立新视窗
function Window_C() {
    this.initialize.apply(this, arguments);
}

Window_C.prototype = Object.create(Window_Base.prototype);
Window_C.prototype.constructor = Window_C;

Window_C.prototype.initialize = function(x, y) {
    var width = this.windowWidth();
    var height = this.windowHeight();
    Window_Base.prototype.initialize.call(this, x, y, width, height);
    this.refresh();
};


//视窗宽度
Window_C.prototype.windowWidth = function() {
    return 200;
};
//视窗高度
Window_C.prototype.windowHeight = function() {
    return 200;
};
//更新动态
Window_C.prototype.refresh = function() {
    var x = this.textPadding();
    var width = this.contents.width - this.textPadding() * 2;
    this.contents.clear();
    //显示文字
    this.drawTextEx('测试窗口1', 0, 0);
    //显示角色脸图
    this.drawFace( 'longw', 0, 0, 30, 150, 150);


};

//视窗底层呼叫
Window_C.prototype.open = function() {
        this.refresh();
    Window_Base.prototype.open.call(this);

};

})();



搞不明白


迭代是人,递归是神
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-5-5 07:41

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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