赞 | 97 |
VIP | 0 |
好人卡 | 1 |
积分 | 76 |
经验 | 10334 |
最后登录 | 2024-6-22 |
在线时间 | 1227 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 7612
- 在线时间
- 1227 小时
- 注册时间
- 2008-12-14
- 帖子
- 555
|
楼主,我加了些设置,希望对你也有用。加了图片名称、宽、高、右边距、上边距的设置。这样更灵活。发布在这层楼。如果不喜欢我的修改或发布,请联系我删除这层。
- //取消键---------------------------------------------------------
- var Imported = Imported || {};
- Imported.yang1zhi_esc = true;
- /*:
- * @plugindesc 取消键!
- * @author 杨志(yang1zhi)
- *
- * @param ---Configuration---
- *
- * @param Pic Name
- * @desc pic name
- * @default ESC
- *
- * @param Pic Width
- * @desc width
- * @default 32
- *
- * @param Pic Height
- * @desc height
- * @default 32
- *
- * @param Right Edge
- * @desc right_edge
- * @default 10
- *
- * @param Up Edge
- * @desc up_edge
- * @default 10
- *
- * @param
- * @help
- * ------------------------------------------------------------------------------
- * 取消键
- * ------------------------------------------------------------------------------
- */
- //Initialize global variables
- (function () {
- var params = PluginManager.parameters("yang1zhi_esc");
- var name = String(params["Pic Name"]);
- var esc_width = Number(params["Pic Width"]);
- var esc_height = Number(params["Pic Height"]);
- var right_edge = Number(params["Right Edge"]);
- var up_edge = Number(params["Up Edge"]);
- Scene_Map.prototype.isMapTouchOk = function() {
- if (this.is_NOmove_window()) {return false}
- return this.isActive() && $gamePlayer.canMove();
- };
-
- //点击后不会移动的窗口
- Scene_Map.prototype.is_NOmove_window = function() {
- //ESC窗口
- if (SceneManager._scene._escWindow.containsPoint({x: TouchInput.x, y: TouchInput.y})) {return true}
- return false
- }
-
-
- ESC_SELECTABLE_UPDATE = Window_Selectable.prototype.update
- Window_Selectable.prototype.update = function() {
- ESC_SELECTABLE_UPDATE.call(this);
- this.CancelCancel(); //取消键
- };
-
- Window_Selectable.prototype.CancelCancel = function() {
- //不活动的窗口跳过
- if (!SceneManager._scene._escWindow) {return}
- //不活动的窗口跳过
- if (!this.isOpenAndActive()) {return}
- //当按下鼠标左键
- if (this.isCancelEnabled() && TouchInput.isTriggered('ok')) {
- //当鼠标X在取消键范围内
- if (SceneManager._scene._escWindow.containsPoint({x: TouchInput.x, y: TouchInput.y})) {
- this.processCancel();
- }
- }
-
- };
-
-
- ESC_DISPLAYOBJECTS = Scene_Map.prototype.createDisplayObjects
- Scene_Map.prototype.createDisplayObjects = function() {
- ESC_DISPLAYOBJECTS.call(this);
- this.createescWindow(); //ESC键
- };
-
- ESC_MENUBASE_SREATE = Scene_MenuBase.prototype.create
- Scene_MenuBase.prototype.create = function() {
- ESC_MENUBASE_SREATE.call(this);
- this.createescWindow(); //ESC键
-
- };
-
-
- Scene_Base.prototype.createescWindow = function() {
- this._escWindow = new Window_esc(Graphics.width- esc_width - right_edge,up_edge,esc_width,esc_height,this.constructor.name);
- this.addChild(this._escWindow);
- };
-
- Scene_Base.prototype.onESCOk = function() {
- //Scene_Map.isActive()
- this._escWindow.activate();
- if (this.constructor.name == 'Scene_Map') {SceneManager.push(Scene_Menu);}
- };
-
-
-
-
-
- //-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- //显示特效图片----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- function Window_esc() {
- this.initialize.apply(this, arguments);
- }
-
- Window_esc.prototype = Object.create(Sprite.prototype);
- Window_esc.prototype.constructor = Window_esc;
-
- Window_esc.prototype.initialize = function(x, y,w,h,name) {
- Sprite.prototype.initialize.call(this);
- this._sc_name = name
- var ww = w || 32
- var hh = h || 32
- this.move(x,y)
- this.contents = new Sprite(new Bitmap(ww, hh));
- this.addChild(this.contents);
- this.bitmap = ImageManager.loadSystem('ESC');
- };
-
-
-
- Window_esc.prototype.update = function() {
- Sprite.prototype.update.call(this);
- //不在地图上跳过
- if (this._sc_name != 'Scene_Map') {return}
- //当按下鼠标左键
- if (TouchInput.isTriggered('ok')) {
- //当鼠标X在取消键范围内
- if (this.containsPoint({x: TouchInput.x, y: TouchInput.y})) {
- //演奏SE
- SoundManager.playSystemSound(1);
- SceneManager.push(Scene_Menu);
- }
- }
- };
- Window_esc.prototype.show = function() {
- this.visible = this.contents.visible = true;
- };
- Window_esc.prototype.hide = function() {
- this.visible = this.contents.visible = false;
- };
- Window_esc.prototype.setAnchor = function (ax, ay) {
- this.anchor.x = this.contents.anchor = ax;
- this.anchor.y = this.contents.anchor = ay;
- };
- Window_esc.prototype.clear = function() {
- this.contents.bitmap.clear();
- };
- Window_esc.prototype.drawIcon = function(iconIndex, x, y) {
- var bitmap = ImageManager.loadSystem('IconSet');
- var sx = iconIndex % 16 * esc_width;
- var sy = Math.floor(iconIndex / 16) * esc_width;
- this.contents.bitmap.blt(bitmap, sx, sy, esc_width, esc_height, x, y);
- };
- })();
复制代码 |
评分
-
查看全部评分
|