设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 102|回复: 0

[转载发布] Bodkaa ScreenFit

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    9072

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    58885
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    68851

    灌水之王

    发表于 2026-7-27 07:47:35 | 显示全部楼层 |阅读模式
    This script allow the game to fit the screen to the resolution set on the pc.

    *Still need to adjust battlemember and enemy position Should work now! Does not support 800x600 or inferior

    **You need a folder for every resolution possible called like the resolution itself(1920x1080, 1024x768, etc)

    //=============================================================================// ScreenFit.js// Version: 1.5//============================================================================= /*: * @plugindesc v 1.5 Fit width and height to the resolution of your screen. Select what folder of battleback have to use. Can force full screen. Can select screen width an height * @author Bodkaa  *@param Fullscreen *@desc 1 = force fullscreen 0 = no force *@default 1  * @param width * @desc set width * @default 816 * @param height * @desc set height * @default 618 * @param Screen resolution set * @desc Possible value: Enabled , Disabled. If enabled use width and height param for screen size, else use the monitor resolution. * @default Disabled*/var parameters = PluginManager.parameters('ScreenFit');var FullScreen = Number(parameters['Fullscreen']);var lineHeight = Window_Base.prototype.lineHeight();var actualWidth = Number (parameters['width']);var actualHeight = Number(parameters['height']);var selectResType = String(parameters['Screen resolution set']);if(selectResType == 'Disabled'){SceneManager._screenWidth  = screen.width;SceneManager._screenHeight = screen.height;SceneManager._boxWidth     = screen.width;SceneManager._boxHeight    = screen.height;}else if (selectResType == 'Enabled'){SceneManager._screenWidth = actualWidth;SceneManager._screenHeight = actualHeight;SceneManager._boxWidth = actualWidth;SceneManager._boxHeight = actualHeight;}SceneManager_run = SceneManager.run;SceneManager.run = function(sceneClass) {   SceneManager_run.call(this, sceneClass);        if (FullScreen == 1){Graphics._switchFullScreen()};};Scene_Battle.prototype.createActorWindow = function() {    this._actorWindow = new Window_BattleActor(0, this._statusWindow.y);    this._actorWindow.setHandler('ok',     this.onActorOk.bind(this));    this._actorWindow.setHandler('cancel', this.onActorCancel.bind(this));    this.addWindow(this._actorWindow);};Scene_Battle.prototype.createEnemyWindow = function() {    this._enemyWindow = new Window_BattleEnemy(0, this._statusWindow.y);    this._enemyWindow.x = Graphics.boxWidth - this._enemyWindow.width;    this._enemyWindow.setHandler('ok',     this.onEnemyOk.bind(this));    this._enemyWindow.setHandler('cancel', this.onEnemyCancel.bind(this));    this.addWindow(this._enemyWindow);};//********************** Change resolution path **********************//ImageManager.loadBattleback1 = function(filename, hue) {    return this.loadBitmap('img/resolution/'+ Graphics.boxWidth + "x" + Graphics.boxHeight + '/battlebacks1/', filename, hue, true);}ImageManager.loadBattleback2 = function(filename, hue) {    return this.loadBitmap('img/resolution/'+ Graphics.boxWidth + "x" + Graphics.boxHeight + '/battlebacks2/', filename, hue, true);}//********************** Sprite_Actor **********************//Sprite_Actor.prototype.setActorHome = function(index) {    this.setHome(Graphics.boxWidth - (Graphics.boxWidth * 0.2) + index * 40 , Graphics.boxHeight / 2 + index * (Graphics.boxHeight / 12.5));};//********************** Sprite_Enemy **********************//Sprite_Enemy.prototype.setBattler = function(battler) {    Sprite_Battler.prototype.setBattler.call(this, battler);    this._enemy = battler;    this.setHome(Graphics.boxWidth -(Graphics.boxWidth) + battler.screenX() , battler.screenY() + (Graphics.boxHeight - lineHeight * 18 ));    this._stateIconSprite.setup(battler);};//********************** GameOver Bitmap *******************//Scene_Gameover.prototype.createBackground = function() {    this._backSprite = new Sprite();        this._backSprite.bitmap = ImageManager.loadBitmap('img/resolution/'+ Graphics.boxWidth + "x" + Graphics.boxHeight + '/system/','GameOver');    this.addChild(this._backSprite);}; V 1.5

    You can now decide if you want use the monitor resolution or set it as your wish.

    V 1.4 

    Modifed the path to img/resolution/resolutionInNumber/battelback 

    Spoiler



    V 1.3

    Added the path for the GameOver image in img/*resolution*/system/  (Thanks to Serpent for the bug report)

    V 1.2 

    Improved Actor and Battler position

    For resize the image you can use this! https://imageresizer.codeplex.com/


    本贴来自国际rpgmaker官方论坛作者:Jecht处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/bodkaa-screenfit.48030/

    本帖子中包含更多资源

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

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-22 07:51 , Processed in 0.138171 second(s), 55 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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