ImageEntity

data class ImageEntity(val path: String = "", val height: Int = 0, val symbol: String? = null, val ascent: Int = 0, val animation: Boolean = false, val duration: Double = 1.0)(source)

PNG/GIF 图片配置;同一图片可按不同 Y 偏移与锚点复用。 PNG/GIF image configuration reusable at different Y offsets and GUI anchors.

Parameters

path

图片路径或基础名称。 / Image path or basename.

height

字形高度;宽度按图片比例计算。 / Glyph height; width follows the image aspect ratio.

animation

是否将 GIF 作为动画处理。 / Whether to process a GIF as an animation.

Constructors

Link copied to clipboard
constructor(path: String = "", height: Int = 0, symbol: String? = null, ascent: Int = 0, animation: Boolean = false, duration: Double = 1.0)

Properties

Link copied to clipboard
Link copied to clipboard
val ascent: Int
Link copied to clipboard
lateinit var basename: String
Link copied to clipboard
Link copied to clipboard
val height: Int
Link copied to clipboard
lateinit var id: String
Link copied to clipboard
lateinit var namespace: String
Link copied to clipboard
Link copied to clipboard

内部生成图片的源目录;不写入配置。 / Source directory for generated images, excluded from configuration.

Link copied to clipboard
Link copied to clipboard

PNG 文件的相对路径,只检查文件名中的扩展名。 / Relative PNG path; only the filename determines its extension.

Link copied to clipboard

Functions

Link copied to clipboard
fun addUnicode(y: Int)

为纵向偏移预留图片字符。 / Reserves an image glyph for a vertical offset.

Link copied to clipboard
fun fontName(anchor: GuiAnchor? = null, opacity: Double = 1.0): String

同组图片共享定位字体;字符编码仍标识各图片和 Y 偏移。 / Shares placement fonts within an image group.

Link copied to clipboard
fun parseComponentString(pixelY: Int, anchor: GuiAnchor? = null, addWidth: Boolean = true): String?

构建图片的原始组件;缺少已登记的偏移时返回 null。 Builds the raw image component; returns null if the offset was not registered.

Link copied to clipboard
fun parseComponentText(pixelY: Int, anchor: GuiAnchor? = null, addWidth: Boolean = true): ComponentText?

构建已解析的图片组件。 / Builds a parsed image component.

Link copied to clipboard
fun parseGif()

解析并准备 GIF 帧资源。 / Parses and prepares GIF frame resources.

Link copied to clipboard
fun parseProviders(): List<BitmapProvider>

生成当前图片的位图字体提供器列表。 / Produces bitmap-font providers for this image.

Link copied to clipboard
fun parseSymbolProvider(): BitmapProvider?

生成可选的默认字体符号提供器。 / Builds the optional default-font symbol provider.

Link copied to clipboard
fun textureDirectory(dataFolder: File? = null): File

实际贴图目录,默认使用用户图片组。 / Actual texture directory, defaulting to the user's image group.

Link copied to clipboard
fun textureFile(dataFolder: File? = null): File

解析实际图片文件,支持内部缓存。 / Resolves the actual image file, including internal caches.

Link copied to clipboard
fun widthPx(): Int

返回按配置高度缩放后的图片 GUI 像素宽度。 / Returns the image width in GUI pixels after scaling.