Skip to content
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

使用精灵图部署物品图标 #8

Merged
merged 3 commits into from
Jan 5, 2024
Merged

Conversation

JimmyZJX
Copy link
Collaborator

@JimmyZJX JimmyZJX commented Jan 4, 2024

该PR分成了3个commit,如果要review的话请逐个看

新的部署方式:

  • ./icon 目录下的所有目录视为game_name
  • 编译时:(npm run build生效,npm run dev不生效)
    • vite-plugin-spritesmith 插件在将每个文件夹的png分别整合成一个大图,输出一个png和一个json(包含子图片位置信息)到./icon目录下
    • 自定义Vite插件,使用imagemin生成压缩的webp和png格式图片,输出到./public/icon目录
  • 运行时:
    • ./src/icon.jsx模组解析上述的json信息文件用于渲染ItemIcon

@JimmyZJX JimmyZJX requested a review from makuwa8992 January 4, 2024 15:59
@makuwa8992 makuwa8992 merged commit f426be2 into main Jan 5, 2024
3 checks passed
@JimmyZJX JimmyZJX deleted the feature-sprite-icon branch January 6, 2024 05:06
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