Best JavaScript code snippet using testcafe
AltMenuScreen3 copy.js
Source:AltMenuScreen3 copy.js
1//=============================================================================2// AltMenuScreen3.js3//=============================================================================4/*:5 * @plugindesc Yet Another menu screen layout.6 * @author Sasuke KANNAZUKI, Yoji Ojima7 * 8 * @default 9 * @param bgBitmapMenu10 * @desc background bitmap file at menu scene. put at img/pictures.11 * @default 12 * 13 * @param bgBitmapItem14 * @desc background bitmap file at item scene. put at img/pictures.15 * @default 16 * 17 * @param bgBitmapSkill18 * @desc background bitmap file at skill scene. put at img/pictures.19 * @default 20 * 21 * @param bgBitmapEquip22 * @desc background bitmap file at equip scene. put at img/pictures.23 * @default 24 * 25 * @param bgBitmapStatus26 * @desc background bitmap file at status scene. put at img/pictures.27 * @default 28 * 29 * @param bgBitmapOptions30 * @desc background bitmap file at option scene. put at img/pictures.31 * @default 32 * 33 * @param bgBitmapFile34 * @desc background bitmap file at save/load scene. put at img/pictures.35 * @default 36 * 37 * @param bgBitmapGameEnd38 * @desc background bitmap file at gameEnd scene. put at img/pictures.39 * @default 40 * 41 * @param maxColsMenu42 * @desc max column at menu window43 * @default 444 * 45 * @param commandRows46 * @desc number of visible rows at command window47 * @default 248 *49 * @param isDisplayStatus50 * @desc whether display status or not. (1 = yes, 0 = no)51 * @default 152 * 53 * @help This plugin does not provide plugin commands.54 * The differences with AltMenuscreen are follows:55 * - windows are transparent at all menu scene.56 * - it can set the background bitmap for each scenes at menu.57 * - picture is actors' original58 *59 * Actor' note:60 * <stand_picture:filename> set actor's standing picture at menu.61 * put file at img/pictures.62 *63 * preferred size of actor's picture:64 * width: 174px(maxColsMenu=4), 240px(maxColsMenu=3)65 * height: 408px(commandRows=2), 444px(commandRows=1)66 */67/*:ja68 * @plugindesc ã¬ã¤ã¢ã¦ãã®ç°ãªãã¡ãã¥ã¼ç»é¢69 * @author ç¥ç¡æãµã¹ã±, Yoji Ojima70 * 71 * @param bgBitmapMenu72 * @desc ã¡ãã¥ã¼èæ¯ã«ãããããããããã¡ã¤ã«ã§ãã73 * img/pictures ã«ç½®ãã¦ãã ããã74 * @default 75 * 76 * @param bgBitmapItem77 * @desc ã¢ã¤ãã ç»é¢èæ¯ã«ãããããããããã¡ã¤ã«ã§ãã78 * img/pictures ã«ç½®ãã¦ãã ããã79 * @default 80 * 81 * @param bgBitmapSkill82 * @desc ã¹ãã«ç»é¢èæ¯ã«ãããããããããã¡ã¤ã«ã§ãã83 * img/pictures ã«ç½®ãã¦ãã ããã84 * @default 85 * 86 * @param bgBitmapEquip87 * @desc è£
åç»é¢èæ¯ã«ãããããããããã¡ã¤ã«ã§ãã88 * img/pictures ã«ç½®ãã¦ãã ããã89 * @default 90 * 91 * @param bgBitmapStatus92 * @desc ã¹ãã¼ã¿ã¹ç»é¢èæ¯ã«ãããããããããã¡ã¤ã«ã§ãã93 * img/pictures ã«ç½®ãã¦ãã ããã94 * @default 95 * 96 * @param bgBitmapOptions97 * @desc ãªãã·ã§ã³ç»é¢èæ¯ã«ãããããããããã¡ã¤ã«ã§ãã98 * img/pictures ã«ç½®ãã¦ãã ããã99 * @default 100 * 101 * @param bgBitmapFile102 * @desc ã»ã¼ãï¼ãã¼ãç»é¢èæ¯ã«ãããããããããã¡ã¤ã«ã§ãã103 * img/pictures ã«ç½®ãã¦ãã ããã104 * @default 105 * 106 * @param bgBitmapGameEnd107 * @desc ã²ã¼ã çµäºç»é¢èæ¯ã«ãããããããããã¡ã¤ã«ã§ãã108 * img/pictures ã«ç½®ãã¦ãã ããã109 * @default 110 * 111 * @param maxColsMenu112 * @desc ã¢ã¯ã¿ã¼ã表示ããã¦ã£ã³ãã¦ã®1ç»é¢ã®ç»é²æ大æ°ã§ãã113 * @default 4114 * 115 * @param commandRows116 * @desc ã³ãã³ãã¦ã£ã³ãã¦ã®è¡æ°ã§ãã117 * @default 2118 *119 * @param isDisplayStatus120 * @desc ã¹ãã¼ã¿ã¹ã表示ãããããªãããé¸ã³ã¾ãã(1 = yes, 0 = no)121 * @default 1122 * 123 * @help ãã®ãã©ã°ã¤ã³ã«ã¯ããã©ã°ã¤ã³ã³ãã³ãã¯ããã¾ããã124 *125 * AltMenuscreen ã¨ã®éãã¯ä»¥ä¸ã§ã:126 * - ã¡ãã¥ã¼ç»é¢ãã¹ã¦ã®ã¦ã£ã³ãã¦ãéæã§ã127 * - ã¡ãã¥ã¼ããããã®ã·ã¼ã³ã«èæ¯ãããããããä»ãããã¨ãåºæ¥ã¾ãã128 * - ã¢ã¯ã¿ã¼ã«ç«ã¡çµµãå©ç¨ãã¾ãã129 *130 * ã¢ã¯ã¿ã¼ã®ã¡ã¢ã«ä»¥ä¸ã®ããã«æ¸ãã¦ãã ãã:131 * <stand_picture:ãã¡ã¤ã«å> ãã¡ã¤ã«åãããã®ã¢ã¯ã¿ã¼ã®ç«ã¡çµµã«ãªãã¾ãã132 * ãã¡ã¤ã«ã¯ img/pictures ã«ç½®ãã¦ãã ããã133 *134 * æã¾ããã¢ã¯ã¿ã¼ç«ã¡çµµã®ãµã¤ãºï¼135 * å¹
ï¼3å:240px, 4åï¼174px136 * é«ãï¼ ã³ãã³ãã¦ã£ã³ã㦠1è¡:444px 2è¡:408px137 *138 */139(function() {140 // set parameters141 var parameters = PluginManager.parameters('AltMenuScreen3');142 var bgBitmapMenu = parameters['bgBitmapMenu'] || '';143 var bgBitmapItem = parameters['bgBitmapItem'] || '';144 var bgBitmapSkill = parameters['bgBitmapSkill'] || '';145 var bgBitmapEquip = parameters['bgBitmapEquip'] || '';146 var bgBitmapStatus = parameters['bgBitmapStatus'] || '';147 var bgBitmapOptions = parameters['bgBitmapOptions'] || '';148 var bgBitmapFile = parameters['bgBitmapFile'] || '';149 var bgBitmapGameEnd = parameters['bgBitmapGameEnd'] || '';150 var maxColsMenuWnd = Number(parameters['maxColsMenu'] || 4);151 var rowsCommandWnd = Number(parameters['commandRows'] || 2);152 var isDisplayStatus = !!Number(parameters['isDisplayStatus']);153 //154 // make transparent windows for each scenes in menu.155 //156 var _Scene_Menu_create = Scene_Menu.prototype.create;157 Scene_Menu.prototype.create = function() {158 _Scene_Menu_create.call(this);159 this._statusWindow.x = 0;160 this._statusWindow.y = this._commandWindow.height;161 this._goldWindow.x = Graphics.boxWidth - this._goldWindow.width;162 // make transparent for all windows at menu scene.163 this._statusWindow.opacity = 0;164 this._goldWindow.opacity = 0;165 this._commandWindow.opacity = 0;166 };167 var _Scene_Item_create = Scene_Item.prototype.create;168 Scene_Item.prototype.create = function() {169 _Scene_Item_create.call(this);170 this._helpWindow.opacity = 0;171 this._categoryWindow.opacity = 0;172 this._itemWindow.opacity = 0;173 this._actorWindow.opacity = 0;174 };175 var _Scene_Skill_create = Scene_Skill.prototype.create;176 Scene_Skill.prototype.create = function() {177 _Scene_Skill_create.call(this);178 this._helpWindow.opacity = 0;179 this._skillTypeWindow.opacity = 0;180 this._statusWindow.opacity = 0;181 this._itemWindow.opacity = 0;182 this._actorWindow.opacity = 0;183 };184 var _Scene_Equip_create = Scene_Equip.prototype.create;185 Scene_Equip.prototype.create = function() {186 _Scene_Equip_create.call(this);187 this._helpWindow.opacity = 0;188 this._statusWindow.opacity = 0;189 this._commandWindow.opacity = 0;190 this._slotWindow.opacity = 0;191 this._itemWindow.opacity = 0;192 };193 var _Scene_Status_create = Scene_Status.prototype.create;194 Scene_Status.prototype.create = function() {195 _Scene_Status_create.call(this);196 this._statusWindow.opacity = 0;197 };198 var _Scene_Options_create = Scene_Options.prototype.create;199 Scene_Options.prototype.create = function() {200 _Scene_Options_create.call(this);201 this._optionsWindow.opacity = 0;202 };203 var _Scene_File_create = Scene_File.prototype.create;204 Scene_File.prototype.create = function() {205 _Scene_File_create.call(this);206 this._helpWindow.opacity = 0;207 this._listWindow.opacity = 0;208 };209 var _Scene_GameEnd_create = Scene_GameEnd.prototype.create;210 Scene_GameEnd.prototype.create = function() {211 _Scene_GameEnd_create.call(this);212 this._commandWindow.opacity = 0;213 };214 //215 // load bitmap that set in plugin parameter216 //217 var _Scene_Menu_createBackground = Scene_Menu.prototype.createBackground;218 Scene_Menu.prototype.createBackground = function(){219 if(bgBitmapMenu){220 this._backgroundSprite = new Sprite();221 this._backgroundSprite.bitmap =222 ImageManager.loadPicture(bgBitmapMenu);223 this.addChild(this._backgroundSprite);224 return;225 }226 // if background file is invalid, it does original process.227 _Scene_Menu_createBackground.call(this);228 };229 var _Scene_Item_createBackground = Scene_Item.prototype.createBackground;230 Scene_Item.prototype.createBackground = function(){231 if(bgBitmapItem){232 this._backgroundSprite = new Sprite();233 this._backgroundSprite.bitmap =234 ImageManager.loadPicture(bgBitmapItem);235 this.addChild(this._backgroundSprite);236 return;237 }238 // if background file is invalid, it does original process.239 _Scene_Item_createBackground.call(this);240 };241 var _Scene_Skill_createBackground = Scene_Skill.prototype.createBackground;242 Scene_Skill.prototype.createBackground = function(){243 if(bgBitmapSkill){244 this._backgroundSprite = new Sprite();245 this._backgroundSprite.bitmap =246 ImageManager.loadPicture(bgBitmapSkill);247 this.addChild(this._backgroundSprite);248 return;249 }250 // if background file is invalid, it does original process.251 _Scene_Skill_createBackground.call(this);252 };253 var _Scene_Equip_createBackground = Scene_Equip.prototype.createBackground;254 Scene_Equip.prototype.createBackground = function(){255 if(bgBitmapEquip){256 this._backgroundSprite = new Sprite();257 this._backgroundSprite.bitmap =258 ImageManager.loadPicture(bgBitmapEquip);259 this.addChild(this._backgroundSprite);260 return;261 }262 // if background file is invalid, it does original process.263 _Scene_Equip_createBackground.call(this);264 };265 var _Scene_Status_createBackground =266 Scene_Status.prototype.createBackground;267 Scene_Status.prototype.createBackground = function(){268 if(bgBitmapStatus){269 this._backgroundSprite = new Sprite();270 this._backgroundSprite.bitmap =271 ImageManager.loadPicture(bgBitmapStatus);272 this.addChild(this._backgroundSprite);273 return;274 }275 // if background file is invalid, it does original process.276 _Scene_Status_createBackground.call(this);277 };278 var _Scene_Options_createBackground =279 Scene_Options.prototype.createBackground;280 Scene_Options.prototype.createBackground = function(){281 if(bgBitmapOptions){282 this._backgroundSprite = new Sprite();283 this._backgroundSprite.bitmap =284 ImageManager.loadPicture(bgBitmapOptions);285 this.addChild(this._backgroundSprite);286 return;287 }288 // if background file is invalid, it does original process.289 _Scene_Options_createBackground.call(this);290 };291 var _Scene_File_createBackground = Scene_File.prototype.createBackground;292 Scene_File.prototype.createBackground = function(){293 if(bgBitmapFile){294 this._backgroundSprite = new Sprite();295 this._backgroundSprite.bitmap =296 ImageManager.loadPicture(bgBitmapFile);297 this.addChild(this._backgroundSprite);298 return;299 }300 // if background file is invalid, it does original process.301 _Scene_File_createBackground.call(this);302 };303 var _Scene_GameEnd_createBackground =304 Scene_GameEnd.prototype.createBackground;305 Scene_GameEnd.prototype.createBackground = function(){306 if(bgBitmapGameEnd){307 this._backgroundSprite = new Sprite();308 this._backgroundSprite.bitmap =309 ImageManager.loadPicture(bgBitmapGameEnd);310 this.addChild(this._backgroundSprite);311 return;312 }313 // if background file is invalid, it does original process.314 _Scene_GameEnd_createBackground.call(this);315 };316 //317 // alt menu screen processes318 //319 Window_MenuCommand.prototype.windowWidth = function() {320 return Graphics.boxWidth;321 };322 Window_MenuCommand.prototype.maxCols = function() {323 return 4;324 };325 Window_MenuCommand.prototype.numVisibleRows = function() {326 return rowsCommandWnd;327 };328 Window_MenuStatus.prototype.windowWidth = function() {329 return Graphics.boxWidth;330 };331 Window_MenuStatus.prototype.windowHeight = function() {332 var h1 = this.fittingHeight(1);333 var h2 = this.fittingHeight(rowsCommandWnd);334 return Graphics.boxHeight - h1 - h2;335 };336 Window_MenuStatus.prototype.maxCols = function() {337 return maxColsMenuWnd;338 };339 Window_MenuStatus.prototype.numVisibleRows = function() {340 return 1;341 };342 Window_MenuStatus.prototype.drawItemImage = function(index) {343 var actor = $gameParty.members()[index];344 var rect = this.itemRectForText(index);345 // load stand_picture346 var bitmapName = $dataActors[actor.actorId()].meta.stand_picture;347 var bitmap = bitmapName ? ImageManager.loadPicture(bitmapName) : null;348 var w = Math.min(rect.width, (bitmapName ? bitmap.width : 144));349 var h = Math.min(rect.height, (bitmapName ? bitmap.height : 144));350 var lineHeight = this.lineHeight();351 this.changePaintOpacity(actor.isBattleMember());352 if(bitmap){353 var sx = (bitmap.width > w) ? (bitmap.width - w) / 2 : 0;354 var sy = (bitmap.height > h) ? (bitmap.height - h) / 2 : 0;355 var dx = (bitmap.width > rect.width) ? rect.x :356 rect.x + (rect.width - bitmap.width) / 2;357 var dy = (bitmap.height > rect.height) ? rect.y :358 rect.y + (rect.height - bitmap.height) / 2;359 this.contents.blt(bitmap, sx, sy, w, h, dx, dy);360 } else { // when bitmap is not set, do the original process.361 this.drawActorFace(actor, rect.x, rect.y + lineHeight * 2.5, w, h);362 }363 this.changePaintOpacity(true);364 };365 Window_MenuStatus.prototype.drawItemStatus = function(index) {366 if(!isDisplayStatus){367 return;368 }369 var actor = $gameParty.members()[index];370 var rect = this.itemRectForText(index);371 var x = rect.x;372 var y = rect.y;373 var width = rect.width;374 var bottom = y + rect.height;375 var lineHeight = this.lineHeight();376 this.drawActorName(actor, x, y + lineHeight * 0, width);377 this.drawActorLevel(actor, x, y + lineHeight * 1, width);378 this.drawActorClass(actor, x, bottom - lineHeight * 4, width);379 this.drawActorHp(actor, x, bottom - lineHeight * 3, width);380 this.drawActorMp(actor, x, bottom - lineHeight * 2, width);381 this.drawActorIcons(actor, x, bottom - lineHeight * 1, width);382 };383 var _Window_MenuActor_initialize = Window_MenuActor.prototype.initialize;384 Window_MenuActor.prototype.initialize = function() {385 _Window_MenuActor_initialize.call(this);386 this.y = this.fittingHeight(2);387 };...
FTKR_SceneBackImages.js
Source:FTKR_SceneBackImages.js
1//=============================================================================2// ã¡ãã¥ã¼ãã·ã§ããç»é¢ãªã©ã«èæ¯ç»åãè¨å®ãããã©ã°ã¤ã³3// FTKR_SceneBackImages.js4// ä½æè
: ããã³ã5// ä½ææ¥ : 2018/02/246// æçµæ´æ°æ¥ : 7// ãã¼ã¸ã§ã³ : v1.0.08//=============================================================================9var Imported = Imported || {};10Imported.FTKR_SBI = true;11var FTKR = FTKR || {};12FTKR.SBI = FTKR.SBI || {};13//=============================================================================14/*:15 * @plugindesc v1.0.0 ã¡ãã¥ã¼ãã·ã§ããç»é¢ãªã©ã«èæ¯ç»åãè¨å®ãããã©ã°ã¤ã³16 * @author ããã³ã17 *18 * @param --ã¡ãã¥ã¼ç»é¢--19 * @default20 * 21 * @param Menu BackImages22 * @desc ã¡ãã¥ã¼ç»é¢ã®èæ¯ãè¨å®ãã¾ãã23 * @type struct<backImage>24 * @default {"images":"[]","variableId":"0"}25 * @parent dataType26 * 27 * @param Item BackImages28 * @desc ã¢ã¤ãã ç»é¢ã®èæ¯ãè¨å®ãã¾ãã29 * @type struct<backImage>30 * @default {"images":"[]","variableId":"0"}31 * @parent dataType32 * 33 * @param Skill BackImages34 * @desc ã¹ãã«ç»é¢ã®èæ¯ãè¨å®ãã¾ãã35 * @type struct<backImage>36 * @default {"images":"[]","variableId":"0"}37 * @parent dataType38 * 39 * @param Equip BackImages40 * @desc è£
åç»é¢ã®èæ¯ãè¨å®ãã¾ãã41 * @type struct<backImage>42 * @default {"images":"[]","variableId":"0"}43 * @parent dataType44 * 45 * @param Status BackImages46 * @desc ã¹ãã¼ã¿ã¹ç»é¢ã®èæ¯ãè¨å®ãã¾ãã47 * @type struct<backImage>48 * @default {"images":"[]","variableId":"0"}49 * @parent dataType50 * 51 * @param Options BackImages52 * @desc ãªãã·ã§ã³ç»é¢ã®èæ¯ãè¨å®ãã¾ãã53 * @type struct<backImage>54 * @default {"images":"[]","variableId":"0"}55 * @parent dataType56 * 57 * @param Save BackImages58 * @desc ã»ã¼ãç»é¢ã®èæ¯ãè¨å®ãã¾ãã59 * @type struct<backImage>60 * @default {"images":"[]","variableId":"0"}61 * @parent dataType62 * 63 * @param GameEnd BackImages64 * @desc ã²ã¼ã çµäºç»é¢ã®èæ¯ãè¨å®ãã¾ãã65 * @type struct<backImage>66 * @default {"images":"[]","variableId":"0"}67 * @parent dataType68 * 69 * @param --ãã¼ãç»é¢--70 * @default71 * 72 * @param Load BackImages73 * @desc ãã¼ãç»é¢ã®èæ¯ãè¨å®ãã¾ãã74 * @type struct<backImage>75 * @default {"images":"[]","variableId":"0"}76 * @parent dataType77 *78 * @param --ã·ã§ããç»é¢--79 * @default80 * 81 * @param Shop BackImages82 * @desc ã·ã§ããç»é¢ã®èæ¯ãè¨å®ãã¾ãã83 * @type struct<backImage>84 * @default {"images":"[]","variableId":"0"}85 * @parent dataType86 *87 * @help 88 *-----------------------------------------------------------------------------89 * æ¦è¦90 *-----------------------------------------------------------------------------91 * ã¡ãã¥ã¼ãã·ã§ããç»é¢ãªã©ã«èæ¯ç»åãè¨å®ãããã¨ãã§ãã¾ãã92 * 93 * â»ä½¿ç¨ããç»å㯠img/picturesãã©ã«ãã«ä¿åãã¦ãã ããã94 * 95 * 96 * åç»é¢ã®ãã©ã°ã¤ã³ãã©ã¡ã¼ã¿ã®èæ¯ç»å<images>ãè¤æ°è¨å®ã97 * åæ¿å¤æ°<variableId>ãè¨å®ããå ´åã¯ãåæ¿å¤æ°ã®å¤ã«åããã¦98 * 表示ããèæ¯ç»åã®çªå·ãå¤ããã¾ãã99 * 100 * ä¾ï¼101 * èæ¯ç»å<images>ã®ãªã¹ãï¼çªã«è¨å®ããç»åã¯102 * åæ¿å¤æ°ã®å¤ãï¼ã®æã«è¡¨ç¤ºãã¾ãã103 * 104 * 105 * èæ¯ç»åãä¸ã¤ãè¨å®ããªããã¾ãã¯åæ¿å¤æ°ã®å¤ãï¼ããªã¹ãã«ãªãçªå·ã®æã¯ã106 * ããã©ã«ãã®èæ¯ï¼ãããç»é¢ã®ã³ãã¼ï¼ã«ãªãã¾ãã107 * 108 * åæ¿å¤æ°ãè¨å®ããªãå ´åã¯ãèæ¯ç»åã®ï¼çªç®ã表示ãã¾ãã109 * 110 * 111 * ãªãã以ä¸ã®ç»é¢ã®ç»åãè¨å®ããªãå ´åãã¡ãã¥ã¼ç»é¢ã®ç»åè¨å®ãé©ç¨ããã¾ãã112 * ã»ã¢ã¤ãã ç»é¢113 * ã»ã¹ãã«ç»é¢114 * ã»è£
åç»é¢115 * ã»ã¹ãã¼ã¿ã¹ç»é¢116 * ã»ãªãã·ã§ã³ç»é¢117 * ã»ã»ã¼ãç»é¢118 * ã»ã²ã¼ã çµäºç»é¢119 * 120 * 121 *-----------------------------------------------------------------------------122 * è¨å®æ¹æ³123 *-----------------------------------------------------------------------------124 * 1.ããã©ã°ã¤ã³ããã¼ã¸ã£ã¼(ãã©ã°ã¤ã³ç®¡ç)ãã«ãæ¬ãã©ã°ã¤ã³ã追å ãã¦125 * ãã ããã126 * 127 * 128 *-----------------------------------------------------------------------------129 * æ¬ãã©ã°ã¤ã³ã®ã©ã¤ã»ã³ã¹ã«ã¤ãã¦(License)130 *-----------------------------------------------------------------------------131 * æ¬ãã©ã°ã¤ã³ã¯MITã©ã¤ã»ã³ã¹ã®ãã¨ã§å
¬éãã¦ãã¾ãã132 * This plugin is released under the MIT License.133 * 134 * Copyright (c) 2018 Futokoro135 * http://opensource.org/licenses/mit-license.php136 * 137 * 138 * ãã©ã°ã¤ã³å
¬éå
139 * https://github.com/futokoro/RPGMaker/blob/master/README.md140 * 141 * 142 *-----------------------------------------------------------------------------143 * å¤æ´æ¥æ´144 *-----------------------------------------------------------------------------145 * 146 * v1.0.0 - 2018/02/24 : åçä½æ147 * 148 *-----------------------------------------------------------------------------149*/150//=============================================================================151/*~struct~backImage:152 * @param images153 * @desc èæ¯ã«è¨å®ããç»åãè¨å®ãã¾ããè¤æ°è¨å®ãããã¨ã§ãã²ã¼ã ä¸ã«å¤æ°ã§åãæ¿ãããã¾ãã154 * @type file[]155 * @default []156 * @require 1157 * @dir img/pictures158 * @parent otherType159 *160 * @param variableId161 * @desc èæ¯ç»åãåãæ¿ããããã®å¤æ°IDãè¨å®ãã¾ãã162 * @type variable163 * @default 0164 * @parent database165*/166(function() {167 var parameters = PluginManager.parameters('FTKR_SceneBackImages');168 var paramParse = function(obj) {169 return JSON.parse(JSON.stringify(obj, paramReplace));170 };171 var paramReplace = function(key, value) {172 try {173 return JSON.parse(value || null);174 } catch (e) {175 return value;176 }177 };178 var setPluginBackImages = function(param) {179 param = paramParse(parameters[param]);180 return param instanceof Object ? param : {images:[],variableId:0};181 };182 //=============================================================================183 // ãã©ã°ã¤ã³ ãã©ã¡ã¼ã¿184 //=============================================================================185 FTKR.SBI = {186 menu : setPluginBackImages('Menu BackImages'),187 item : setPluginBackImages('Item BackImages'),188 skill : setPluginBackImages('Skill BackImages'),189 equip : setPluginBackImages('Equip BackImages'),190 status : setPluginBackImages('Status BackImages'),191 save : setPluginBackImages('Save BackImages'),192 options : setPluginBackImages('Options BackImages'),193 gameEnd : setPluginBackImages('GameEnd BackImages'),194 load : setPluginBackImages('Load BackImages'),195 shop : setPluginBackImages('Shop BackImages'),196 };197 //=============================================================================198 // å
±éå¦ç199 //=============================================================================200 Scene_Base.prototype.setBackgoundImage = function(scene) {201 this._backgroundSprite = new Sprite();202 var index = scene.variableId ? $gameVariables.value(scene.variableId) - 1 : 0;203 var bgiName = index >= 0 ? scene.images[index] : null;204 this._backgroundSprite.bitmap = bgiName ?205 ImageManager.loadPicture(bgiName) : SceneManager.backgroundBitmap();206 this.addChild(this._backgroundSprite);207 };208 Scene_Base.prototype.setSbiParams = function(scene) {209 return Array.isArray(scene.images) && scene.images[0] ? scene : FTKR.SBI.menu;210 };211 Scene_Base.prototype.enabledSceneBackImage = function(scene) {212 return Array.isArray(scene.images) && !scene.images[0];213 };214 //=============================================================================215 // ã¡ãã¥ã¼ç»é¢ã®å¤æ´216 //=============================================================================217 var _SBI_Scene_Menu_createBackground = Scene_Menu.prototype.createBackground;218 Scene_Menu.prototype.createBackground = function() {219 var scene = FTKR.SBI.menu;220 if (this.enabledSceneBackImage(scene)) {221 _SBI_Scene_Menu_createBackground.call(this);222 } else {223 this.setBackgoundImage(scene);224 }225 };226 var _SBI_Scene_Item_createBackground = Scene_Item.prototype.createBackground;227 Scene_Item.prototype.createBackground = function() {228 var menu = this.setSbiParams(FTKR.SBI.item);229 if (this.enabledSceneBackImage(menu)) {230 _SBI_Scene_Item_createBackground.call(this);231 } else {232 this.setBackgoundImage(menu);233 }234 };235 var _SBI_Scene_Skill_createBackground = Scene_Skill.prototype.createBackground;236 Scene_Skill.prototype.createBackground = function() {237 var menu = this.setSbiParams(FTKR.SBI.skill);238 if (this.enabledSceneBackImage(menu)) {239 _SBI_Scene_Skill_createBackground.call(this);240 } else {241 this.setBackgoundImage(menu);242 }243 };244 var _SBI_Scene_Equip_createBackground = Scene_Equip.prototype.createBackground;245 Scene_Equip.prototype.createBackground = function() {246 var menu = this.setSbiParams(FTKR.SBI.equip);247 if (this.enabledSceneBackImage(menu)) {248 _SBI_Scene_Equip_createBackground.call(this);249 } else {250 this.setBackgoundImage(menu);251 }252 };253 var _SBI_Scene_Status_createBackground = Scene_Status.prototype.createBackground;254 Scene_Status.prototype.createBackground = function() {255 var menu = this.setSbiParams(FTKR.SBI.status);256 if (this.enabledSceneBackImage(menu)) {257 _SBI_Scene_Status_createBackground.call(this);258 } else {259 this.setBackgoundImage(menu);260 }261 };262 var _SBI_Scene_Options_createBackground = Scene_Options.prototype.createBackground;263 Scene_Options.prototype.createBackground = function() {264 var options = this.setSbiParams(FTKR.SBI.options);265 if (this.enabledSceneBackImage(options)) {266 _SBI_Scene_Options_createBackground.call(this);267 } else {268 this.setBackgoundImage(options);269 }270 };271 var _SBI_Scene_Save_createBackground = Scene_Save.prototype.createBackground;272 Scene_Save.prototype.createBackground = function() {273 var save = this.setSbiParams(FTKR.SBI.save);274 if (this.enabledSceneBackImage(save)) {275 _SBI_Scene_Save_createBackground.call(this);276 } else {277 this.setBackgoundImage(save);278 }279 };280 var _SBI_Scene_GameEnd_createBackground = Scene_GameEnd.prototype.createBackground;281 Scene_GameEnd.prototype.createBackground = function() {282 var menu = this.setSbiParams(FTKR.SBI.gameEnd);283 if (this.enabledSceneBackImage(menu)) {284 _SBI_Scene_GameEnd_createBackground.call(this);285 } else {286 this.setBackgoundImage(menu);287 this.setBackgroundOpacity(128);288 }289 };290 //=============================================================================291 // ãã¼ãç»é¢ã®å¤æ´292 //=============================================================================293 var _SBI_Scene_Load_createBackground = Scene_Load.prototype.createBackground;294 Scene_Load.prototype.createBackground = function() {295 var load = FTKR.SBI.load;296 if (this.enabledSceneBackImage(load)) {297 _SBI_Scene_Load_createBackground.call(this);298 } else {299 this.setBackgoundImage(load);300 }301 };302 //=============================================================================303 // ã·ã§ããç»é¢ã®å¤æ´304 //=============================================================================305 var _SBI_Scene_Shop_createBackground = Scene_Shop.prototype.createBackground;306 Scene_Shop.prototype.createBackground = function() {307 var shop = FTKR.SBI.shop;308 if (this.enabledSceneBackImage(shop)) {309 _SBI_Scene_Shop_createBackground.call(this);310 } else {311 this.setBackgoundImage(shop);312 }313 };...
AltMenuScreen3.js
Source:AltMenuScreen3.js
1//=============================================================================2// AltMenuScreen3.js3//=============================================================================4/*:5 * @plugindesc AltMenuScreen2æ件çå级çï¼çé¢å¸å±æ件ã6 * @author Sasuke KANNAZUKI, Yoji Ojima7 * 8 * @default 9 * @param bgBitmapMenu10 * @desc èåçé¢çèæ¯å¾çï¼æ¾å°img/picturesç®å½ä¸11 * @default 12 * 13 * @param bgBitmapItem14 * @desc ç©åçé¢çèæ¯å¾çï¼æ¾å°img/picturesç®å½ä¸15 * @default 16 * 17 * @param bgBitmapSkill18 * @desc æè½çé¢çèæ¯å¾çï¼æ¾å°img/picturesç®å½ä¸19 * @default 20 * 21 * @param bgBitmapEquip22 * @desc è£
å¤çé¢çèæ¯å¾çï¼æ¾å°img/picturesç®å½ä¸23 * @default 24 * 25 * @param bgBitmapStatus26 * @desc ç¶æçé¢çèæ¯å¾çï¼æ¾å°img/picturesç®å½ä¸27 * @default 28 * 29 * @param bgBitmapOptions30 * @desc é项çé¢çèæ¯å¾çï¼æ¾å°img/picturesç®å½ä¸31 * @default 32 * 33 * @param bgBitmapFile34 * @desc åæ¡£/读档çé¢çèæ¯å¾çï¼æ¾å°img/picturesç®å½ä¸35 * @default 36 * 37 * @param bgBitmapGameEnd38 * @desc 游æç»æçé¢çèæ¯å¾çï¼æ¾å°img/picturesç®å½ä¸39 * @default 40 * 41 * @param maxColsMenu42 * @desc èåçªå£çè§è²å¤´åç纵åæ°é43 * @default 444 * 45 * @param commandRows46 * @desc æ令çªå£çæé®å¯è§æ¨ªè¡æ°é47 * @default 248 *49 * @param isDisplayStatus50 * @desc æ¯å¦æ¾ç¤ºè§è²ç¶æï¼1 = æ¯ï¼0 = å¦ï¼51 * @default 152 * 53 * @help æ¬æ件ä¸AltMenuscreençä¸å:54 * - ææçé¢çªå£çèæ¯é»è®¤é½æ¯éæç55 * - æ¬æ件å¯ä»¥è®¾ç½®ææçé¢çªå£çèæ¯å¾56 * - è§è²å½¢è±¡å¾çå¯èªå®ä¹57 *58 * è§è²å¤æ³¨åºï¼59 * <stand_picture:å¾çåå(ä¸å«åç¼)> 设置è§è²çèå形象å¾ç60 * å°æ件æ¾å¨img/picturesä¸ã61 *62 * è§è²èå形象å¾ççæ佳尺寸63 * 宽度: 174åç´ (maxColsMenu=4), 240åç´ (maxColsMenu=3)64 * é«åº¦: 408åç´ (commandRows=2), 444åç´ (commandRows=1)65 */66(function() {67 // set parameters68 var parameters = PluginManager.parameters('AltMenuScreen3');69 var bgBitmapMenu = parameters['bgBitmapMenu'] || '';70 var bgBitmapItem = parameters['bgBitmapItem'] || '';71 var bgBitmapSkill = parameters['bgBitmapSkill'] || '';72 var bgBitmapEquip = parameters['bgBitmapEquip'] || '';73 var bgBitmapStatus = parameters['bgBitmapStatus'] || '';74 var bgBitmapOptions = parameters['bgBitmapOptions'] || '';75 var bgBitmapFile = parameters['bgBitmapFile'] || '';76 var bgBitmapGameEnd = parameters['bgBitmapGameEnd'] || '';77 var maxColsMenuWnd = Number(parameters['maxColsMenu'] || 4);78 var rowsCommandWnd = Number(parameters['commandRows'] || 2);79 var isDisplayStatus = !!Number(parameters['isDisplayStatus']);80 //81 // make transparent windows for each scenes in menu.82 //83 var _Scene_Menu_create = Scene_Menu.prototype.create;84 Scene_Menu.prototype.create = function() {85 _Scene_Menu_create.call(this);86 this._statusWindow.x = 0;87 this._statusWindow.y = this._commandWindow.height;88 this._goldWindow.x = Graphics.boxWidth - this._goldWindow.width;89 // make transparent for all windows at menu scene.90 this._statusWindow.opacity = 0;91 this._goldWindow.opacity = 0;92 this._commandWindow.opacity = 0;93 };94 var _Scene_Item_create = Scene_Item.prototype.create;95 Scene_Item.prototype.create = function() {96 _Scene_Item_create.call(this);97 this._helpWindow.opacity = 0;98 this._categoryWindow.opacity = 0;99 this._itemWindow.opacity = 0;100 this._actorWindow.opacity = 0;101 };102 var _Scene_Skill_create = Scene_Skill.prototype.create;103 Scene_Skill.prototype.create = function() {104 _Scene_Skill_create.call(this);105 this._helpWindow.opacity = 0;106 this._skillTypeWindow.opacity = 0;107 this._statusWindow.opacity = 0;108 this._itemWindow.opacity = 0;109 this._actorWindow.opacity = 0;110 };111 var _Scene_Equip_create = Scene_Equip.prototype.create;112 Scene_Equip.prototype.create = function() {113 _Scene_Equip_create.call(this);114 this._helpWindow.opacity = 0;115 this._statusWindow.opacity = 0;116 this._commandWindow.opacity = 0;117 this._slotWindow.opacity = 0;118 this._itemWindow.opacity = 0;119 };120 var _Scene_Status_create = Scene_Status.prototype.create;121 Scene_Status.prototype.create = function() {122 _Scene_Status_create.call(this);123 this._statusWindow.opacity = 0;124 };125 var _Scene_Options_create = Scene_Options.prototype.create;126 Scene_Options.prototype.create = function() {127 _Scene_Options_create.call(this);128 this._optionsWindow.opacity = 0;129 };130 var _Scene_File_create = Scene_File.prototype.create;131 Scene_File.prototype.create = function() {132 _Scene_File_create.call(this);133 this._helpWindow.opacity = 0;134 this._listWindow.opacity = 0;135 };136 var _Scene_GameEnd_create = Scene_GameEnd.prototype.create;137 Scene_GameEnd.prototype.create = function() {138 _Scene_GameEnd_create.call(this);139 this._commandWindow.opacity = 0;140 };141 //142 // load bitmap that set in plugin parameter143 //144 var _Scene_Menu_createBackground = Scene_Menu.prototype.createBackground;145 Scene_Menu.prototype.createBackground = function(){146 if(bgBitmapMenu){147 this._backgroundSprite = new Sprite();148 this._backgroundSprite.bitmap =149 ImageManager.loadPicture(bgBitmapMenu);150 this.addChild(this._backgroundSprite);151 return;152 }153 // if background file is invalid, it does original process.154 _Scene_Menu_createBackground.call(this);155 };156 var _Scene_Item_createBackground = Scene_Item.prototype.createBackground;157 Scene_Item.prototype.createBackground = function(){158 if(bgBitmapItem){159 this._backgroundSprite = new Sprite();160 this._backgroundSprite.bitmap =161 ImageManager.loadPicture(bgBitmapItem);162 this.addChild(this._backgroundSprite);163 return;164 }165 // if background file is invalid, it does original process.166 _Scene_Item_createBackground.call(this);167 };168 var _Scene_Skill_createBackground = Scene_Skill.prototype.createBackground;169 Scene_Skill.prototype.createBackground = function(){170 if(bgBitmapSkill){171 this._backgroundSprite = new Sprite();172 this._backgroundSprite.bitmap =173 ImageManager.loadPicture(bgBitmapSkill);174 this.addChild(this._backgroundSprite);175 return;176 }177 // if background file is invalid, it does original process.178 _Scene_Skill_createBackground.call(this);179 };180 var _Scene_Equip_createBackground = Scene_Equip.prototype.createBackground;181 Scene_Equip.prototype.createBackground = function(){182 if(bgBitmapEquip){183 this._backgroundSprite = new Sprite();184 this._backgroundSprite.bitmap =185 ImageManager.loadPicture(bgBitmapEquip);186 this.addChild(this._backgroundSprite);187 return;188 }189 // if background file is invalid, it does original process.190 _Scene_Equip_createBackground.call(this);191 };192 var _Scene_Status_createBackground =193 Scene_Status.prototype.createBackground;194 Scene_Status.prototype.createBackground = function(){195 if(bgBitmapStatus){196 this._backgroundSprite = new Sprite();197 this._backgroundSprite.bitmap =198 ImageManager.loadPicture(bgBitmapStatus);199 this.addChild(this._backgroundSprite);200 return;201 }202 // if background file is invalid, it does original process.203 _Scene_Status_createBackground.call(this);204 };205 var _Scene_Options_createBackground =206 Scene_Options.prototype.createBackground;207 Scene_Options.prototype.createBackground = function(){208 if(bgBitmapOptions){209 this._backgroundSprite = new Sprite();210 this._backgroundSprite.bitmap =211 ImageManager.loadPicture(bgBitmapOptions);212 this.addChild(this._backgroundSprite);213 return;214 }215 // if background file is invalid, it does original process.216 _Scene_Options_createBackground.call(this);217 };218 var _Scene_File_createBackground = Scene_File.prototype.createBackground;219 Scene_File.prototype.createBackground = function(){220 if(bgBitmapFile){221 this._backgroundSprite = new Sprite();222 this._backgroundSprite.bitmap =223 ImageManager.loadPicture(bgBitmapFile);224 this.addChild(this._backgroundSprite);225 return;226 }227 // if background file is invalid, it does original process.228 _Scene_File_createBackground.call(this);229 };230 var _Scene_GameEnd_createBackground =231 Scene_GameEnd.prototype.createBackground;232 Scene_GameEnd.prototype.createBackground = function(){233 if(bgBitmapGameEnd){234 this._backgroundSprite = new Sprite();235 this._backgroundSprite.bitmap =236 ImageManager.loadPicture(bgBitmapGameEnd);237 this.addChild(this._backgroundSprite);238 return;239 }240 // if background file is invalid, it does original process.241 _Scene_GameEnd_createBackground.call(this);242 };243 //244 // alt menu screen processes245 //246 Window_MenuCommand.prototype.windowWidth = function() {247 return Graphics.boxWidth;248 };249 Window_MenuCommand.prototype.maxCols = function() {250 return 4;251 };252 Window_MenuCommand.prototype.numVisibleRows = function() {253 return rowsCommandWnd;254 };255 Window_MenuStatus.prototype.windowWidth = function() {256 return Graphics.boxWidth;257 };258 Window_MenuStatus.prototype.windowHeight = function() {259 var h1 = this.fittingHeight(1);260 var h2 = this.fittingHeight(rowsCommandWnd);261 return Graphics.boxHeight - h1 - h2;262 };263 Window_MenuStatus.prototype.maxCols = function() {264 return maxColsMenuWnd;265 };266 Window_MenuStatus.prototype.numVisibleRows = function() {267 return 1;268 };269 Window_MenuStatus.prototype.drawItemImage = function(index) {270 var actor = $gameParty.members()[index];271 var rect = this.itemRectForText(index);272 // load stand_picture273 var bitmapName = $dataActors[actor.actorId()].meta.stand_picture;274 var bitmap = bitmapName ? ImageManager.loadPicture(bitmapName) : null;275 var w = Math.min(rect.width, (bitmapName ? bitmap.width : 144));276 var h = Math.min(rect.height, (bitmapName ? bitmap.height : 144));277 var lineHeight = this.lineHeight();278 this.changePaintOpacity(actor.isBattleMember());279 if(bitmap){280 var sx = (bitmap.width > w) ? (bitmap.width - w) / 2 : 0;281 var sy = (bitmap.height > h) ? (bitmap.height - h) / 2 : 0;282 var dx = (bitmap.width > rect.width) ? rect.x :283 rect.x + (rect.width - bitmap.width) / 2;284 var dy = (bitmap.height > rect.height) ? rect.y :285 rect.y + (rect.height - bitmap.height) / 2;286 this.contents.blt(bitmap, sx, sy, w, h, dx, dy);287 } else { // when bitmap is not set, do the original process.288 this.drawActorFace(actor, rect.x, rect.y + lineHeight * 2.5, w, h);289 }290 this.changePaintOpacity(true);291 };292 Window_MenuStatus.prototype.drawItemStatus = function(index) {293 if(!isDisplayStatus){294 return;295 }296 var actor = $gameParty.members()[index];297 var rect = this.itemRectForText(index);298 var x = rect.x;299 var y = rect.y;300 var width = rect.width;301 var bottom = y + rect.height;302 var lineHeight = this.lineHeight();303 this.drawActorName(actor, x, y + lineHeight * 0, width);304 this.drawActorLevel(actor, x, y + lineHeight * 1, width);305 this.drawActorClass(actor, x, bottom - lineHeight * 4, width);306 this.drawActorHp(actor, x, bottom - lineHeight * 3, width);307 this.drawActorMp(actor, x, bottom - lineHeight * 2, width);308 this.drawActorIcons(actor, x, bottom - lineHeight * 1, width);309 };310 var _Window_MenuActor_initialize = Window_MenuActor.prototype.initialize;311 Window_MenuActor.prototype.initialize = function() {312 _Window_MenuActor_initialize.call(this);313 this.y = this.fittingHeight(2);314 };...
candle-chart.component.js
Source:candle-chart.component.js
...120 121 122 // chart.scrollbarX = new am4core.Scrollbar();123 // series. = am4core.color("red");124 function createBackground(x, y, widthin, heightin, colorin) {125 var rect = chart.createChild(am4core.Rectangle);126 rect.isMeasured = false;127 rect.width = am4core.percent(widthin);128 rect.height = am4core.percent(heightin);129 rect.x = am4core.percent(x);130 rect.y = am4core.percent(y);131 rect.opacity = .3;132 rect.fill = colorin;133 chart.plotContainer.children.push(rect);134 rect.defaultState.transitionDuration = 0;135 rect.hiddenState.transitionDuration = 0;136 }137 138 if(chart.data.length === 3){139 createBackground(0, 0, 16, 100, "red");140 createBackground(16, 0, 17, 100, "blue");141 createBackground(33, 0, 17, 100, "red");142 createBackground(50, 0, 17, 100, "blue");143 createBackground(67, 0, 16, 100, "red");144 createBackground(83, 0, 17, 100, "blue");145 } else if (chart.data.length === 2){ 146 createBackground(0, 0, 24, 100, "red");147 createBackground(24, 0, 26, 100, "blue");148 createBackground(50, 0, 26, 100, "red");149 createBackground(76, 0, 24, 100, "blue");150 } else if(chart.data.length === 7){151 createBackground(0, 0, 7, 100, "red");152 createBackground(7, 0, 7.5, 100, "blue");153 createBackground(14.4, 0, 7, 100, "red");154 createBackground(21.3, 0, 7.2, 100, "blue");155 createBackground(28.4, 0, 7, 100, "red");156 createBackground(35.3, 0, 7.5, 100, "blue");157 createBackground(42.9, 0, 7, 100, "red");158 createBackground(49.8, 0, 7.3, 100, "blue");159 createBackground(56.9, 0, 7, 100, "red");160 createBackground(63.8, 0, 7.3, 100, "blue");161 createBackground(71.1, 0, 7, 100, "red");162 createBackground(78, 0, 7.5, 100, "blue");163 createBackground(85.5, 0, 7, 100, "red");164 createBackground(92.5, 0, 7.5, 100, "blue");165 } else if(chart.data.length === 6){166 createBackground(0, 0, 8, 100, "red");167 createBackground(8, 0, 8.5, 100, "blue");168 createBackground(16.6, 0, 8.2, 100, "red");169 createBackground(24.8, 0, 8.3, 100, "blue");170 createBackground(33.1, 0, 8.3, 100, "red");171 createBackground(41.3, 0, 8.5, 100, "blue");172 createBackground(49.9, 0, 8.5, 100, "red");173 createBackground(58.3, 0, 8.5, 100, "blue");174 createBackground(66.7, 0, 8.5, 100, "red");175 createBackground(75.2, 0, 8.2, 100, "blue");176 createBackground(83.3, 0, 8.2, 100, "red");177 createBackground(91.4, 0, 8.6, 100, "blue");178 } else if(chart.data.length === 5){179 createBackground(0, 0, 10, 100, "red");180 createBackground(10, 0, 10, 100, "blue");181 createBackground(20, 0, 10, 100, "red");182 createBackground(30, 0, 10, 100, "blue");183 createBackground(40, 0, 10, 100, "red");184 createBackground(50, 0, 10, 100, "blue");185 createBackground(60, 0, 10, 100, "red");186 createBackground(70, 0, 10, 100, "blue");187 createBackground(80, 0, 10, 100, "red");188 createBackground(90, 0, 10, 100, "blue");189 }else if(chart.data.length === 4){190 createBackground(0, 0, 13, 100, "red");191 createBackground(13, 0, 12, 100, "blue");192 createBackground(25, 0, 12, 100, "red");193 createBackground(37, 0, 13, 100, "blue");194 createBackground(50, 0, 13, 100, "red");195 createBackground(63, 0, 12, 100, "blue");196 createBackground(75, 0, 13, 100, "red");197 createBackground(88, 0, 12, 100, "blue");198 }else if(chart.data.length === 1){199 createBackground(0, 0, 50, 100, "red");200 createBackground(50, 0, 50, 100, "blue");201 }else if(chart.data.length === 8){202 createBackground(0, 0, 7, 100, "red");203 createBackground(7, 0, 5.5, 100, "blue");204 createBackground(12.5, 0, 6.2, 100, "red");205 createBackground(18.6, 0, 6.2, 100, "blue");206 createBackground(24.8, 0, 6.2, 100, "red");207 createBackground(30.9, 0, 6.4, 100, "blue");208 createBackground(37.4, 0, 6.4, 100, "red");209 createBackground(43.8, 0, 6.3, 100, "blue");210 createBackground(50.1, 0, 6.3, 100, "red");211 createBackground(56.2, 0, 6.3, 100, "blue");212 createBackground(62.4, 0, 6.3, 100, "red");213 createBackground(68.7, 0, 6.3, 100, "blue");214 createBackground(75, 0, 6.3, 100, "red");215 createBackground(81.2, 0, 6.2, 100, "blue");216 createBackground(87.4, 0, 6.3, 100, "red");217 createBackground(93.6, 0, 6.3, 100, "blue");218 }219 chart.maxZoomLevel = 1;220 chart.seriesContainer.draggable = false;221 chart.seriesContainer.resizable = false;222};223 componentWillUnmount() {224 if (this.chart) {225 this.chart.dispose();226 }227 }228 render() {229 return (230 <div id="candelchart" style={{ height:'400px' }}>231 </div>...
MenubackGround.js
Source:MenubackGround.js
1//=============================================================================2// MenubackGround.js3//=============================================================================4/*:5 * @plugindesc ã¡ãã¥ã¼ç»é¢ã®èæ¯ãå¤æ´ãã¾ãã6 * @author Yoji Ojima, Sasuke KANNAZUKI,7 *8 * @param backGroundBitmap9 * @desc èæ¯ã«ãããããããããã¡ã¤ã«ã§ãã10 * img/pictures ã«ç½®ãã¦ãã ããã11 * @default 12 * 13 * @help ãã®ãã©ã°ã¤ã³ã«ã¯ããã©ã°ã¤ã³ã³ãã³ãã¯ããã¾ããã14 *15 *ãããã©ã«ãã®ã¡ãã¥ã¼ã®ã¿å¯¾å¿ã16 *ãAltMenuScreen3.jsãããèæ¯è¨å®æ©è½ã移æ¤ãã¾ããã17 *ãããã©ã«ãã®ã¡ãã¥ã¼ã«èæ¯ãæå®ã§ãã¾ãã18 *19 * 使ç¨å ±åä¸è¦ã»ã¯ã¬ã¸ããä¸è¦ã»æ¹å¤å¯ã»åç¨å©ç¨å¯20 * ããä½ãåé¡ãèµ·ãã¦ããå½æ¹ã¯ä¸å責任ãè² ãã¾ããããäºæ¿ãã ããã21 */22(function() {23 // set parameters24 var parameters = PluginManager.parameters('MenubackGround');25 var backGroundBitmap = parameters['backGroundBitmap'] || '';26 // load bitmap that set in plugin parameter27 var _Scene_Menu_createBackground = Scene_Menu.prototype.createBackground;28 Scene_Menu.prototype.createBackground = function(){29 if(backGroundBitmap){30 this._backgroundSprite = new Sprite();31 this._backgroundSprite.bitmap =32 ImageManager.loadPicture(backGroundBitmap);33 this.addChild(this._backgroundSprite);34 return;35 }36 // if background file is invalid, it does original process.37 _Scene_Menu_createBackground.call(this);38 };39 var _Scene_Item_createBackground = Scene_Item.prototype.createBackground;40 Scene_Item.prototype.createBackground = function(){41 if(backGroundBitmap){42 this._backgroundSprite = new Sprite();43 this._backgroundSprite.bitmap =44 ImageManager.loadPicture(backGroundBitmap);45 this.addChild(this._backgroundSprite);46 return;47 }48 // if background file is invalid, it does original process.49 _Scene_Item_createBackground.call(this);50 };51 var _Scene_Skill_createBackground = Scene_Skill.prototype.createBackground;52 Scene_Skill.prototype.createBackground = function(){53 if(backGroundBitmap){54 this._backgroundSprite = new Sprite();55 this._backgroundSprite.bitmap =56 ImageManager.loadPicture(backGroundBitmap);57 this.addChild(this._backgroundSprite);58 return;59 }60 // if background file is invalid, it does original process.61 _Scene_Skill_createBackground.call(this);62 };63 var _Scene_Equip_createBackground = Scene_Equip.prototype.createBackground;64 Scene_Equip.prototype.createBackground = function(){65 if(backGroundBitmap){66 this._backgroundSprite = new Sprite();67 this._backgroundSprite.bitmap =68 ImageManager.loadPicture(backGroundBitmap);69 this.addChild(this._backgroundSprite);70 return;71 }72 // if background file is invalid, it does original process.73 _Scene_Equip_createBackground.call(this);74 };75 var _Scene_Status_createBackground =76 Scene_Status.prototype.createBackground;77 Scene_Status.prototype.createBackground = function(){78 if(backGroundBitmap){79 this._backgroundSprite = new Sprite();80 this._backgroundSprite.bitmap =81 ImageManager.loadPicture(backGroundBitmap);82 this.addChild(this._backgroundSprite);83 return;84 }85 // if background file is invalid, it does original process.86 _Scene_Status_createBackground.call(this);87 };88 var _Scene_Options_createBackground =89 Scene_Options.prototype.createBackground;90 Scene_Options.prototype.createBackground = function(){91 if(backGroundBitmap){92 this._backgroundSprite = new Sprite();93 this._backgroundSprite.bitmap =94 ImageManager.loadPicture(backGroundBitmap);95 this.addChild(this._backgroundSprite);96 return;97 }98 // if background file is invalid, it does original process.99 _Scene_Options_createBackground.call(this);100 };101 var _Scene_File_createBackground = Scene_File.prototype.createBackground;102 Scene_File.prototype.createBackground = function(){103 if(backGroundBitmap){104 this._backgroundSprite = new Sprite();105 this._backgroundSprite.bitmap =106 ImageManager.loadPicture(backGroundBitmap);107 this.addChild(this._backgroundSprite);108 return;109 }110 // if background file is invalid, it does original process.111 _Scene_File_createBackground.call(this);112 };113 var _Scene_GameEnd_createBackground =114 Scene_GameEnd.prototype.createBackground;115 Scene_GameEnd.prototype.createBackground = function(){116 if(backGroundBitmap){117 this._backgroundSprite = new Sprite();118 this._backgroundSprite.bitmap =119 ImageManager.loadPicture(backGroundBitmap);120 this.addChild(this._backgroundSprite);121 return;122 }123 // if background file is invalid, it does original process.124 _Scene_GameEnd_createBackground.call(this);125 };...
TillingBackgroundForScene.js
Source:TillingBackgroundForScene.js
12Scene_Menu.prototype.createBackground = function()3{4 this._BS = new TilingSprite();5 this._BS.move(0, 0, Graphics.width, Graphics.height);6 this._BS.bitmap = ImageManager.loadPicture("Utilities/Background");7 this.addChild(this._BS);8}910Scene_Menu.prototype.update = function()11{12 Scene_MenuBase.prototype.update.call(this);13 this._BS.origin.x += +114}1516Scene_ItemBase.prototype.createBackground = function()17{18 this._BS = new TilingSprite();19 this._BS.move(0, 0, Graphics.width, Graphics.height);20 this._BS.bitmap = ImageManager.loadPicture("Utilities/Background");21 this.addChild(this._BS);22}2324Scene_ItemBase.prototype.update = function()25{26 Scene_MenuBase.prototype.update.call(this);27 this._BS.origin.x += +128}2930Scene_Skill.prototype.createBackground = function()31{32 this._BS = new TilingSprite();33 this._BS.move(0, 0, Graphics.width, Graphics.height);34 this._BS.bitmap = ImageManager.loadPicture("Utilities/Background");35 this.addChild(this._BS);36}3738Scene_Skill.prototype.update = function()39{40 Scene_MenuBase.prototype.update.call(this);41 this._BS.origin.x += +142}4344Scene_Equip.prototype.createBackground = function()45{46 this._BA = new TilingSprite();47 this._BA.move(0, 0, Graphics.width, Graphics.height);48 this._BA.bitmap = ImageManager.loadPicture("Utilities/Background");49 this.addChild(this._BA);50}5152Scene_Equip.prototype.update = function()53{54 Scene_MenuBase.prototype.update.call(this);55 this._BA.origin.x += +156}575859Scene_Status.prototype.createBackground = function()60{61 this._BA = new TilingSprite();62 this._BA.move(0, 0, Graphics.width, Graphics.height);63 this._BA.bitmap = ImageManager.loadPicture("Utilities/Background");64 this.addChild(this._BA);65}6667Scene_Status.prototype.update = function()68{69 Scene_MenuBase.prototype.update.call(this);70 this._BA.origin.x += +171}727374Scene_Options.prototype.createBackground = function()75{76 this._BA = new TilingSprite();77 this._BA.move(0, 0, Graphics.width, Graphics.height);78 this._BA.bitmap = ImageManager.loadPicture("Utilities/Background");79 this.addChild(this._BA);80}8182Scene_Options.prototype.update = function()83{84 Scene_MenuBase.prototype.update.call(this);85 this._BA.origin.x += +186}878889Scene_File.prototype.createBackground = function()90{91 this._BA = new TilingSprite();92 this._BA.move(0, 0, Graphics.width, Graphics.height);93 this._BA.bitmap = ImageManager.loadPicture("Utilities/Background");94 this.addChild(this._BA);95}9697Scene_File.prototype.update = function()98{99 Scene_MenuBase.prototype.update.call(this);100 this._BA.origin.x += +1101}102103Scene_Save.prototype.createBackground = function()104{105 this._BA = new TilingSprite();106 this._BA.move(0, 0, Graphics.width, Graphics.height);107 this._BA.bitmap = ImageManager.loadPicture("Utilities/Background");108 this.addChild(this._BA);109}110111Scene_Save.prototype.update = function()112{113 Scene_MenuBase.prototype.update.call(this);114 this._BA.origin.x += +1115}116117118Scene_Load.prototype.createBackground = function()119{120 this._BA = new TilingSprite();121 this._BA.move(0, 0, Graphics.width, Graphics.height);122 this._BA.bitmap = ImageManager.loadPicture("Utilities/Background");123 this.addChild(this._BA);124}125126Scene_Load.prototype.update = function()127{128 Scene_MenuBase.prototype.update.call(this);129 this._BA.origin.x += +1130}131132133Scene_GameEnd.prototype.createBackground = function()134{135 this._BA = new TilingSprite();136 this._BA.move(0, 0, Graphics.width, Graphics.height);137 this._BA.bitmap = ImageManager.loadPicture("Utilities/Background");138 this.addChild(this._BA);139}140141Scene_GameEnd.prototype.update = function()142{143 Scene_MenuBase.prototype.update.call(this);144 this._BA.origin.x += +1145}146147Scene_Shop.prototype.createBackground = function()148{149 this._BA = new TilingSprite();150 this._BA.move(0, 0, Graphics.width, Graphics.height);151 this._BA.bitmap = ImageManager.loadPicture("Utilities/Background");152 this.addChild(this._BA);153}154155Scene_Shop.prototype.update = function()156{157 Scene_MenuBase.prototype.update.call(this);158 this._BA.origin.x += +1
...
filtration.js
Source:filtration.js
...119 document.getElementById( "buttonBackgroundBuy0" ).setAttribute( "class", "button buy off" );120 121 } 122 123 createBackground( "White", "bg0.png", 60 );124 createBackground( "Black", "bg1.png", 60 );125 createBackground( "Red", "bg2.png", 60 );126 createBackground( "Yellow", "bg3.png", 60 );127 createBackground( "Blue", "bg4.png", 60 );128 129 createBackground( "Orange", "bg5.png", 90 );130 createBackground( "Green", "bg6.png", 90 );131 createBackground( "Violet", "bg7.png", 90 );132 createBackground( "Brown", "bg8.png", 90 );133 createBackground( "Sepia", "bg9.png", 90 );134 135 createBackground( "Metal", "bg10.png", 120 );136 createBackground( "Rivets", "bg11.png", 120 );137 createBackground( "Rust", "bg12.png", 120 );138 createBackground( "Fun", "bg13.png", 180 );139 createBackground( "Transparent", "bg14.png", 240 ); 140 141 this.getBackgroundData = function( num, data ) {142 return background[num][data];143 }144145146147}148
...
Using AI Code Generation
1import { createBackground } from 'testcafe-browser-provider-electron';2 .beforeEach(async t => {3 });4test('My Test', async t => {5});6import { createBackground } from 'testcafe-browser-provider-electron';7import { ClientFunction } from 'testcafe';8 .beforeEach(async t => {9 });10test('My Test', async t => {11});12import { createBackground, closeBackground } from 'testcafe-browser-provider-electron';13import { ClientFunction } from 'testcafe';14 .beforeEach(async t => {15 })16 .afterEach(async t => {17 await closeBackground(t);18 });19test('My Test', async t => {20 await t.switchToMainWindow();21 await t.switchToMainWindow();22});23import { createBackground, closeBackground } from 'testcafe-browser-provider-electron';24 .beforeEach(async t => {25 })26 .afterEach(async t => {27 await closeBackground(t);28 });29test('My Test', async t => {30});31import { createBackground, resizeBackground } from 'testcafe-browser-provider-electron';
Using AI Code Generation
1import { Selector } from 'testcafe';2import { createBackground } from 'testcafe-browser-provider-electron';3test('My Test', async t => {4 await createBackground(t, './app.js');5 const developerNameInput = Selector('#developer-name');6 .typeText(developerNameInput, 'Peter Parker')7 .click('#macos');8});9const { app } = require('electron');10const path = require('path');11app.on('ready', () => {12 const mainWindow = new BrowserWindow({13 webPreferences: {14 preload: path.join(__dirname, 'preload.js')15 }16 });17 mainWindow.loadFile('index.html');18});19window.addEventListener('DOMContentLoaded', () => {20 const replaceText = (selector, text) => {21 const element = document.getElementById(selector)22 if (element) element.innerText = text23 }24 for (const dependency of ['chrome', 'node', 'electron']) {25 replaceText(`${dependency}-version`, process.versions[dependency])26 }27});28 <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
Using AI Code Generation
1import { Selector } from 'testcafe';2import { createBackground } from 'testcafe-browser-provider-electron';3test('My Test', async t => {4 .setNativeDialogHandler(() => true)5 .click('#populate')6 .click('#submit-button');7 .click('#macos')8 .click('#submit-button');9});
Using AI Code Generation
1import { ClientFunction } from 'testcafe';2import { createBackground } from 'testcafe-browser-tools';3test('My test', async t => {4 .click('#populate')5 .click('#submit-button');6 const screenshotPath = './images/backgroundPage.png';7 await createBackground(screenshotPath);8});9createBackground( screenshotPath [, takeScreenshotOnFail ] )10import { createBackground } from 'testcafe-browser-tools';11test('My test', async t => {12 .click('#populate')13 .click('#submit-button');14 const screenshotPath = './images/backgroundPage.png';15 await createBackground(screenshotPath, true);16});
Using AI Code Generation
1import { Selector } from 'testcafe';2import { createBackground } from 'testcafe-browser-provider-electron';3 .beforeEach(async t => {4 await t.setNativeDialogHandler(() => true);5 await t.setTestSpeed(0.7);6 await t.maximizeWindow();7 })8 .before(async () => {9 await createBackground();10 });11test('My Test', async t => {12});13I have tried setting the window size to a specific value (like 1000,1000) but it
Using AI Code Generation
1import { Selector } from 'testcafe';2import { createBackground } from 'testcafe-browser-provider-electron';3test('My Test', async t => {4 .click(Selector('#macos'))5 .click(Selector('#submit-button'));6});7import { Selector } from 'testcafe';8import { createWindow } from 'testcafe-browser-provider-electron';9test('My Test', async t => {10 .switchToWindow(windowId)11 .click(Selector('#windows'))12 .click(Selector('#submit-button'));13});14openBrowser(id, pageUrl, browserName)15closeBrowser(id)16isLocalBrowser(browserName)
Using AI Code Generation
1import { createBackground } from 'testcafe-browser-provider-electron';2import { ClientFunction } from 'testcafe';3 .before(async ctx => {4 ctx.backgroundPage = await createBackground('background.html');5 });6test('My test', async t => {7 const { backgroundPage } = t.fixtureCtx;8 const { document } = backgroundPage;9 const text = document.querySelector('h1').textContent;10 await t.expect(text).eql('Hello world');11});12import { createBackground } from 'testcafe-browser-provider-electron';13import { ClientFunction } from 'testcafe';14 .before(async ctx => {15 ctx.backgroundPage = await createBackground('background.html', { preload: 'preload.js' });16 });17test('My test', async t => {18 const { backgroundPage } = t.fixtureCtx;19 const { document } = backgroundPage;20 const text = document.querySelector('h1').textContent;21 await t.expect(text).eql('Hello world');22});23window.addEventListener('DOMContentLoaded', () => {24 const h1 = document.createElement('h1');25 h1.textContent = 'Hello world';26 document.body.appendChild(h1);27});28import { createBackground } from 'testcafe-browser-provider-electron';29import { ClientFunction } from 'testcafe';30 .before(async ctx => {31 ctx.backgroundPage = await createBackground('background.html', {32 webPreferences: {33 }34 });35 });36test('My test', async t => {37 const { backgroundPage } = t.fixtureCtx;38 const { document } = backgroundPage;39 const text = document.querySelector('h1').textContent;40 await t.expect(text).eql('Hello world');41});
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!