AxolotlClient Rendering
本库允许对某些圆角形状(例如矩形)、静态 SVG 和 TrueType 字体进行基于光影的渲染。
对于 SVG,包含了 Apache Batik 库;对于字体,使用了 Freetype¹。
对于玩家
这是一个库,你通常不需要手动安装它。(除非有人错误地声明了依赖关系或忘记将其包含在内)
对于模组开发者
在项目中的引入
本库发布在 。
dependencies {
modImplementation(include("io.github.axolotlclient.rendering:AxolotlClient-rendering:VERSION+MINECRAFT_VERSION")!!)
}
注意:如果你不想将此库嵌入到你的模组中,可以省略 include 语句。在这种情况下,请确保正确声明你的依赖关系,以便启动器能够下载该库。
提示:如果你正在编写一个使用此库的库,请将
modImplementation替换为modApi!
一般用法
本库的大多数方法可以通过 Minecraft 的 GuiGraphics 类访问,具体是通过注入的 GuiGraphicsExtension 接口。
在 1.8.9 版本中,由于没有 GuiGraphics 类,你应该使用 DrawUtil.get() 获取 GuiGraphicsExtension。
所有通过这种方式暴露的方法都以 axolotlclient_rendering 为前缀。
可以使用 Font.read(...) 加载字体。如果你使用的是可变字体,这将自动读取变体并适当地利用它们,
然而 FreeType 直接支持的字体功能相当有限。
如果特定功能由单独的字体文件提供(例如 斜体 或 粗体 变体),则可以使用 Font#addSubFont 添加它们,并指定应在何种条件下使用这些变体
(一些标签和值可以在 Font 类中找到作为静态定义)。
使用此库的项目
你的项目使用了此库,并希望在此处显示?请告知我们!
常见问题解答
-
我在 1.20.1 上使用此库,但字体看起来很糟糕
答:因为 Minecraft 1.20.1 使用的是 lwjgl 3.3.1,当时还没有 Freetype 绑定,因此本库使用了 STB_Truetype,它不支持微调(可能还有其他我们不知道的 bug)。
-
但是 1.8.9 不是使用 lwjgl2 吗?这也低于 3.3.2 吧?
答:确实如此,不过借助 legacy-lwjgl3,我们可以在 lwjgl 3.3.6 上运行,在那里我们有 Freetype 的绑定。
-
难道不能在 1.20.1 上也使用更新的 lwjgl 吗?
答:可以,但这更加困难,会进一步增加 jar 包的大小,并且会与像 sodium 这样的模组产生不兼容,因为这些模组会检查它们运行的 lwjgl 版本。
¹见常见问题解答,答案 #1
AxolotlClient Rendering
This library allows for shader-based rendering of some rounded shapes (e.g. rectangles), static SVGs and TrueType fonts.
For SVGs the Apache Batik library is included, for fonts Freetype¹ is used.
For Players
This is a library, you should not need to install it manually. (Unless someone declared their dependencies wrong or forgot to include it)
For Mod Developers
Inclusion in your project
This library is published at .
dependencies {
modImplementation(include("io.github.axolotlclient.rendering:AxolotlClient-rendering:VERSION+MINECRAFT_VERSION")!!)
}
Note: you may omit the include statement if you do not want to embed this library into your mod. Make sure to declare your dependencies correctly for launchers to download the library in that case.
Tip: replace
modImplementationwithmodApiif you're writing a library that uses this one!
General Usage
Most methods of this library are accessible using Minecraft's GuiGraphics class via the injected GuiGraphicsExtension interface.
On 1.8.9, since there is no GuiGraphics class you should obtain a GuiGraphicsExtension using DrawUtil.get().
All methods exposed via this way are prefixed with axolotlclient_rendering.
Fonts can be loaded using Font.read(...). If you're using a variant font
this will automatically read the variants and make use of them appropriately,
however the font features supported by FreeType directly are rather limited.
If a specific feature is provided by a separate font file (for example an italic or
bold variant) they can be added using Font#addSubFont, specifying in which conditions it should be used
(some tags and values can be found as static definitions in the Font class).
Projects that use this library
Your project makes use of this library and you would like it to appear here? Let us know!
FAQ
-
I'm using this library on 1.20.1 and the font looks bad
A: Because Minecraft 1.20.1 uses lwjgl 3.3.1 which did not have Freetype bindings yet this library uses STB_Truetype, which does not support hinting (there may also be other bugs we don't know about).
-
But doesn't 1.8.9 use lwjgl2 which is also below 3.3.2?
A: Indeed, however with legacy-lwjgl3 we can run it on lwjgl 3.3.6 where we do have bindings to Freetype.
-
Wouldn't it be possible to use a newer lwjgl on 1.20.1 as well?
A: Yes, but this is more difficult, increases the jar size even further and will produce incompatibilities with mods like sodium which check for which lwjgl version they're running on.
¹See FAQ, answer #1
下载 AxolotlClient Rendering
下载 AxolotlClient Rendering
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 AxolotlClient Rendering
下载 AxolotlClient Rendering
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 AxolotlClient Rendering
下载 AxolotlClient Rendering
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 AxolotlClient Rendering
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 AxolotlClient Rendering
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 AxolotlClient Rendering
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 AxolotlClient Rendering
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
更新日志位于
提交记录:3cd18eea
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
AE2:一款流行的自动化与存储模组
评论 0
登录后参与评分
还没有评论,来抢沙发吧