Skip to content

feat: add resolution settings #687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

HardyNLee
Copy link
Contributor

@HardyNLee HardyNLee commented May 6, 2025

介绍

可通过修改 config.txt 中的 Canvas_width Canvas_height 来设置游戏的分辨率
image

主要改动

  • WebgalCore 新增 canvasWidthcanvasHeight 两个属性
  • index.html 中的部分脚本,迁移到 PixiController.ts ,以便更好的调整宽高
  • InitialScript 现在会强制等待 InfoFetcher 执行完毕,因为需要等待读取Config并做必要设置,再创建PixiStage
  • 移除了所有写定的2560*1440,包括 TS、HTML 和 CSS
  • 使标题图和开场 LOGO 居中

限制

  • 不能通过 setVar 来修改 Canvas_width Canvas_height,请手动修改 config.txt 或使用 WebGAL Terre
  • 每次设置完需要刷新游戏以生效

@MakinoharaShoko
Copy link
Member

应当限制宽高比,以及宽度和高度的数值,在一定范围间变化,超出这些范围的调整应当被拒绝。需要保证游戏的 UI,包括存读档界面和鉴赏界面等,在这样的分辨率下保持正常。

update adaptive ui

fix backlog max width

uptate config file
@HardyNLee HardyNLee force-pushed the feat-add-resolution-settings branch from 5a74767 to 88c7a1f Compare May 8, 2025 06:26
@HardyNLee
Copy link
Contributor Author

HardyNLee commented May 8, 2025

@MakinoharaShoko 已调整大部分界面,目前已适配1440*1440至同高更宽的分辨率,分辨率宽于2560将限制部分界面宽度

关于做限制,有一点与您不同的看法

  • 很难权衡应当做多少限制,无法预测创作者更喜欢什么样的分辨率,我记得既然能暴露出来,就不用作太多隐式的限制,以免给创作者造成困扰
  • 比起限制,我觉得更应当在文档或者WebGAL Terre中明显提示创作者,让创作者自行承担改分辨率的后果

    推荐分辨率为2560*1440,修改为其他分辨率会影响UI布局和立绘定位,建议在项目一开始就设定好画布分辨率,并测试界面布局是否合适

  • 修改界面的工程过于庞大,我认为应当在单独提一个PR以处理,此PR只专注于暴露画布分辨率的参数
界面 1 : 1
1440 * 1440
21 : 9
3360* 1440
主界面
游戏对话

底部按钮可滚动
快速读存档弹窗可自适应预览图
回想
存档 / 读档

顶部页数可水平滚动
单页存档可垂直滚动
预览图自适应大小
选项

可垂直滚动
按钮自适应排布
鉴赏模式

顶部页数可水平滚动
可垂直滚动
自适应CG图比例
音乐列表展开后可垂直滚动

@MakinoharaShoko
Copy link
Member

setRootSize 函数放在 PixiStage 这个类里面,虽然实现上是没问题的,但是由于其作用范围实际上不是 PixiStage,而是外部 UI,放在这个类里可能有些奇怪。

@HardyNLee
Copy link
Contributor Author

setRootSize 函数放在 PixiStage 这个类里面,虽然实现上是没问题的,但是由于其作用范围实际上不是 PixiStage,而是外部 UI,放在这个类里可能有些奇怪。

其实我也不太明白应该放哪,只是需要找个能拿到document的地方,您可以安排一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants