minerender 2.1.0-alpha.68 → 2.1.0-alpha.69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -992,6 +992,27 @@ interface EntityModelOptions {
992
992
  textures?: Record<string, BasicAssetKey>;
993
993
  }
994
994
 
995
+ interface BitmapGlyph {
996
+ image?: CompatCanvas;
997
+ /** Source rectangle in the bitmap sheet, before applying scale. */
998
+ x: number;
999
+ y: number;
1000
+ width: number;
1001
+ height: number;
1002
+ scale: number;
1003
+ ascent: number;
1004
+ advance: number;
1005
+ }
1006
+ interface BitmapFont {
1007
+ glyphs: Map<string, BitmapGlyph>;
1008
+ }
1009
+ declare class Fonts {
1010
+ static get(key?: AssetKey | string): Promise<BitmapFont>;
1011
+ private static relatedKey;
1012
+ private static load;
1013
+ private static bitmap;
1014
+ }
1015
+
995
1016
  declare class Models {
996
1017
  private static _persistentCache;
997
1018
  private static get PERSISTENT_CACHE();
@@ -1311,13 +1332,56 @@ interface EntityObjectOptions extends SceneObjectOptions {
1311
1332
  }
1312
1333
  declare function isEntityObject(obj: any): obj is EntityObject;
1313
1334
 
1335
+ interface GuiTextStyle {
1336
+ /** sRGB 0xRRGGBB; defaults to white. */
1337
+ color?: number;
1338
+ bold?: boolean;
1339
+ italic?: boolean;
1340
+ }
1341
+ interface GuiTextRun extends GuiTextStyle {
1342
+ text: string;
1343
+ }
1344
+ /** Literal text, or styled runs. Newlines are preserved. */
1345
+ type GuiText = string | readonly GuiTextRun[];
1346
+ interface GuiTextOptions extends GuiTextStyle {
1347
+ /** Font resource ID; defaults to minecraft:default. */
1348
+ font?: AssetKey | string;
1349
+ /** Draws a one-pixel shadow; defaults to true. */
1350
+ shadow?: boolean;
1351
+ /** Wrap width in GUI pixels. Long words break at glyph boundaries. */
1352
+ maxWidth?: number;
1353
+ /** Distance between line origins; defaults to 9 GUI pixels. */
1354
+ lineHeight?: number;
1355
+ }
1356
+ interface PositionedGuiGlyph {
1357
+ character: string;
1358
+ glyph?: BitmapGlyph;
1359
+ x: number;
1360
+ y: number;
1361
+ advance: number;
1362
+ style: Required<GuiTextStyle>;
1363
+ }
1364
+ interface GuiTextLayout {
1365
+ glyphs: PositionedGuiGlyph[];
1366
+ lineWidths: number[];
1367
+ width: number;
1368
+ height: number;
1369
+ }
1370
+ /** Measures and wraps text using the same glyph advances used for rendering. */
1371
+ declare function layoutGuiText(text: GuiText, options?: GuiTextOptions): Promise<GuiTextLayout>;
1372
+ /** Creates glyph batches in painter order. Unsupported characters use an outlined missing glyph. */
1373
+ declare function createGuiTextGeometry(layout: GuiTextLayout, shadow?: boolean): {
1374
+ image?: CompatCanvas;
1375
+ geometry: BufferGeometry;
1376
+ }[];
1377
+
1314
1378
  /** GUI layers use pixel coordinates. Later layers draw above earlier layers. */
1315
- type GuiLayer = GuiTextureLayer | GuiItemLayer;
1379
+ type GuiLayer = GuiTextureLayer | GuiItemLayer | GuiTextLayer;
1316
1380
  interface GuiLayerLayout {
1317
1381
  name?: string;
1318
1382
  /** Top-left position; x grows right and y grows down. Defaults to [0, 0]. */
1319
1383
  position?: [number, number];
1320
- /** Output size; defaults to crop, sprite metadata, or image dimensions, and [16, 16] for items. */
1384
+ /** Output size; defaults to native texture/text dimensions, and [16, 16] for items. */
1321
1385
  size?: [number, number];
1322
1386
  }
1323
1387
  interface GuiTextureLayer extends GuiLayerLayout {
@@ -1331,6 +1395,9 @@ interface GuiItemLayer extends GuiLayerLayout {
1331
1395
  /** sRGB 0xRRGGBB colors by face tint index; omitted indices stay white. */
1332
1396
  tints?: Record<number, number>;
1333
1397
  }
1398
+ interface GuiTextLayer extends GuiLayerLayout, GuiTextOptions {
1399
+ text: GuiText;
1400
+ }
1334
1401
 
1335
1402
  declare class GuiObject extends SceneObject {
1336
1403
  readonly textureLayers: readonly GuiLayer[];
@@ -1339,6 +1406,7 @@ declare class GuiObject extends SceneObject {
1339
1406
  readonly bounds: Box2;
1340
1407
  private readonly geometries;
1341
1408
  private readonly ownedMaterials;
1409
+ private readonly textMaterials;
1342
1410
  private initialized;
1343
1411
  constructor(textureLayers: readonly GuiLayer[], options?: Partial<GuiObjectOptions>);
1344
1412
  init(): Promise<void>;
@@ -1834,6 +1902,7 @@ declare class Caching {
1834
1902
  static readonly entityTextureCache: AsyncLoadingCache<CacheKey, AssetKey>;
1835
1903
  static readonly entityAnimationCache: AsyncLoadingCache<CacheKey, EntityAnimationFile>;
1836
1904
  static readonly blockEntityIndexCache: AsyncLoadingCache<CacheKey, BlockEntityIndex>;
1905
+ static readonly fontCache: AsyncLoadingCache<CacheKey, BitmapFont>;
1837
1906
  private static createAssetCache;
1838
1907
  /** Every cache above, so clear()/end() can never fall out of sync with the field list again. */
1839
1908
  private static get all();
@@ -1876,10 +1945,18 @@ declare class SceneExporter {
1876
1945
  }
1877
1946
 
1878
1947
  declare class GuiHelper {
1948
+ /** Sizes a tooltip around supplied text; the first entry is its title. */
1949
+ static tooltip(lines: readonly GuiText[], options?: GuiTooltipOptions): Promise<GuiLayer[]>;
1879
1950
  static inventorySlot(slot: number | [number, number], origin?: [number, number], offset?: [number, number], rowSize?: number): [number, number];
1880
1951
  /** Creates crafting-table layers for ingredients and the result; stack counts are not drawn. */
1881
1952
  static recipe(recipe: GuiRecipe, options?: GuiRecipeOptions): GuiLayer[];
1882
1953
  }
1954
+ interface GuiTooltipOptions extends GuiTextOptions {
1955
+ /** Top-left text position, inside the tooltip's padding. */
1956
+ position?: [number, number];
1957
+ /** Extra space after the title, in pixels. Defaults to 2. */
1958
+ titleGap?: number;
1959
+ }
1883
1960
  type GuiRecipeIngredientValue = string | {
1884
1961
  item: string;
1885
1962
  } | {
@@ -2449,4 +2526,4 @@ declare class BrowserCache extends PersistentCache<LocalForage> {
2449
2526
  */
2450
2527
  declare function probeImageSize(data: Uint8Array): ImageSizeInfo;
2451
2528
 
2452
- export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, ArchiveAssetSource, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type Block, BlockEntities, type BlockEntityEntry, type BlockEntityIndex, type BlockEntityPart, type BlockEntityRotation, type BlockFluidState, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, BlockStateResolver, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, BrowserCache, BrowserEnv, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, Colormaps, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, ENTITY_ANIMATION_CHANNELS, type ElementFace, type ElementRotation, Entities, type EntityAnimation, type EntityAnimationBone, type EntityAnimationChannel, type EntityAnimationFile, type EntityAnimationKeyframe, type EntityAnimationOptions, EntityAnimationPlayer, type EntityAnimationPose, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, type EntityModelPass, EntityObject, type EntityObjectOptions, type EntityRenderMode, type EntityTransformOp, Env, type EnvProvider, type ExtractableImageData, type FluidKind, FluidModelObject, type FluidSample, type FluidSampler, type FrameCallback, type FromTo, Geometries, GuiHelper, type GuiItemLayer, type GuiLayer, GuiLight, GuiObject, type GuiObjectOptions, type GuiRecipe, type GuiRecipeIngredient, type GuiRecipeOptions, type GuiSpriteScaling, type GuiTextureLayer, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ItemTintColor, type ItemTintSource, ItemTints, type ListAsset, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MineRenderWorldOptions, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, ModelCulling, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockEntity, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, OrbitControls, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererFrame, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResolvedBlockEntity, type ResponseParser, SKIN_PARTS, SceneExporter, type SceneGLTFExportOptions, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, type SpecialItemPart, type SpecialItemRenderer, SpecialItems, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createFluidGeometry, createGuiTextureGeometry, createImage, entityAnimationTime, estimateBytesUsed, getBlockFluidState, getFluidKind, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isGuiObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, probeImageSize, registerBrowserEnv, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };
2529
+ export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, ArchiveAssetSource, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type BitmapFont, type BitmapGlyph, type Block, BlockEntities, type BlockEntityEntry, type BlockEntityIndex, type BlockEntityPart, type BlockEntityRotation, type BlockFluidState, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, BlockStateResolver, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, BrowserCache, BrowserEnv, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, Colormaps, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, ENTITY_ANIMATION_CHANNELS, type ElementFace, type ElementRotation, Entities, type EntityAnimation, type EntityAnimationBone, type EntityAnimationChannel, type EntityAnimationFile, type EntityAnimationKeyframe, type EntityAnimationOptions, EntityAnimationPlayer, type EntityAnimationPose, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, type EntityModelPass, EntityObject, type EntityObjectOptions, type EntityRenderMode, type EntityTransformOp, Env, type EnvProvider, type ExtractableImageData, type FluidKind, FluidModelObject, type FluidSample, type FluidSampler, Fonts, type FrameCallback, type FromTo, Geometries, GuiHelper, type GuiItemLayer, type GuiLayer, GuiLight, GuiObject, type GuiObjectOptions, type GuiRecipe, type GuiRecipeIngredient, type GuiRecipeOptions, type GuiSpriteScaling, type GuiText, type GuiTextLayer, type GuiTextLayout, type GuiTextOptions, type GuiTextRun, type GuiTextStyle, type GuiTextureLayer, type GuiTooltipOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ItemTintColor, type ItemTintSource, ItemTints, type ListAsset, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MineRenderWorldOptions, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, ModelCulling, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockEntity, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, OrbitControls, PersistentCache, type PositionedGuiGlyph, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererFrame, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResolvedBlockEntity, type ResponseParser, SKIN_PARTS, SceneExporter, type SceneGLTFExportOptions, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, type SpecialItemPart, type SpecialItemRenderer, SpecialItems, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createFluidGeometry, createGuiTextGeometry, createGuiTextureGeometry, createImage, entityAnimationTime, estimateBytesUsed, getBlockFluidState, getFluidKind, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isGuiObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, layoutGuiText, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, probeImageSize, registerBrowserEnv, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };
@@ -992,6 +992,27 @@ interface EntityModelOptions {
992
992
  textures?: Record<string, BasicAssetKey>;
993
993
  }
994
994
 
995
+ interface BitmapGlyph {
996
+ image?: CompatCanvas;
997
+ /** Source rectangle in the bitmap sheet, before applying scale. */
998
+ x: number;
999
+ y: number;
1000
+ width: number;
1001
+ height: number;
1002
+ scale: number;
1003
+ ascent: number;
1004
+ advance: number;
1005
+ }
1006
+ interface BitmapFont {
1007
+ glyphs: Map<string, BitmapGlyph>;
1008
+ }
1009
+ declare class Fonts {
1010
+ static get(key?: AssetKey | string): Promise<BitmapFont>;
1011
+ private static relatedKey;
1012
+ private static load;
1013
+ private static bitmap;
1014
+ }
1015
+
995
1016
  declare class Models {
996
1017
  private static _persistentCache;
997
1018
  private static get PERSISTENT_CACHE();
@@ -1311,13 +1332,56 @@ interface EntityObjectOptions extends SceneObjectOptions {
1311
1332
  }
1312
1333
  declare function isEntityObject(obj: any): obj is EntityObject;
1313
1334
 
1335
+ interface GuiTextStyle {
1336
+ /** sRGB 0xRRGGBB; defaults to white. */
1337
+ color?: number;
1338
+ bold?: boolean;
1339
+ italic?: boolean;
1340
+ }
1341
+ interface GuiTextRun extends GuiTextStyle {
1342
+ text: string;
1343
+ }
1344
+ /** Literal text, or styled runs. Newlines are preserved. */
1345
+ type GuiText = string | readonly GuiTextRun[];
1346
+ interface GuiTextOptions extends GuiTextStyle {
1347
+ /** Font resource ID; defaults to minecraft:default. */
1348
+ font?: AssetKey | string;
1349
+ /** Draws a one-pixel shadow; defaults to true. */
1350
+ shadow?: boolean;
1351
+ /** Wrap width in GUI pixels. Long words break at glyph boundaries. */
1352
+ maxWidth?: number;
1353
+ /** Distance between line origins; defaults to 9 GUI pixels. */
1354
+ lineHeight?: number;
1355
+ }
1356
+ interface PositionedGuiGlyph {
1357
+ character: string;
1358
+ glyph?: BitmapGlyph;
1359
+ x: number;
1360
+ y: number;
1361
+ advance: number;
1362
+ style: Required<GuiTextStyle>;
1363
+ }
1364
+ interface GuiTextLayout {
1365
+ glyphs: PositionedGuiGlyph[];
1366
+ lineWidths: number[];
1367
+ width: number;
1368
+ height: number;
1369
+ }
1370
+ /** Measures and wraps text using the same glyph advances used for rendering. */
1371
+ declare function layoutGuiText(text: GuiText, options?: GuiTextOptions): Promise<GuiTextLayout>;
1372
+ /** Creates glyph batches in painter order. Unsupported characters use an outlined missing glyph. */
1373
+ declare function createGuiTextGeometry(layout: GuiTextLayout, shadow?: boolean): {
1374
+ image?: CompatCanvas;
1375
+ geometry: BufferGeometry;
1376
+ }[];
1377
+
1314
1378
  /** GUI layers use pixel coordinates. Later layers draw above earlier layers. */
1315
- type GuiLayer = GuiTextureLayer | GuiItemLayer;
1379
+ type GuiLayer = GuiTextureLayer | GuiItemLayer | GuiTextLayer;
1316
1380
  interface GuiLayerLayout {
1317
1381
  name?: string;
1318
1382
  /** Top-left position; x grows right and y grows down. Defaults to [0, 0]. */
1319
1383
  position?: [number, number];
1320
- /** Output size; defaults to crop, sprite metadata, or image dimensions, and [16, 16] for items. */
1384
+ /** Output size; defaults to native texture/text dimensions, and [16, 16] for items. */
1321
1385
  size?: [number, number];
1322
1386
  }
1323
1387
  interface GuiTextureLayer extends GuiLayerLayout {
@@ -1331,6 +1395,9 @@ interface GuiItemLayer extends GuiLayerLayout {
1331
1395
  /** sRGB 0xRRGGBB colors by face tint index; omitted indices stay white. */
1332
1396
  tints?: Record<number, number>;
1333
1397
  }
1398
+ interface GuiTextLayer extends GuiLayerLayout, GuiTextOptions {
1399
+ text: GuiText;
1400
+ }
1334
1401
 
1335
1402
  declare class GuiObject extends SceneObject {
1336
1403
  readonly textureLayers: readonly GuiLayer[];
@@ -1339,6 +1406,7 @@ declare class GuiObject extends SceneObject {
1339
1406
  readonly bounds: Box2;
1340
1407
  private readonly geometries;
1341
1408
  private readonly ownedMaterials;
1409
+ private readonly textMaterials;
1342
1410
  private initialized;
1343
1411
  constructor(textureLayers: readonly GuiLayer[], options?: Partial<GuiObjectOptions>);
1344
1412
  init(): Promise<void>;
@@ -1834,6 +1902,7 @@ declare class Caching {
1834
1902
  static readonly entityTextureCache: AsyncLoadingCache<CacheKey, AssetKey>;
1835
1903
  static readonly entityAnimationCache: AsyncLoadingCache<CacheKey, EntityAnimationFile>;
1836
1904
  static readonly blockEntityIndexCache: AsyncLoadingCache<CacheKey, BlockEntityIndex>;
1905
+ static readonly fontCache: AsyncLoadingCache<CacheKey, BitmapFont>;
1837
1906
  private static createAssetCache;
1838
1907
  /** Every cache above, so clear()/end() can never fall out of sync with the field list again. */
1839
1908
  private static get all();
@@ -1876,10 +1945,18 @@ declare class SceneExporter {
1876
1945
  }
1877
1946
 
1878
1947
  declare class GuiHelper {
1948
+ /** Sizes a tooltip around supplied text; the first entry is its title. */
1949
+ static tooltip(lines: readonly GuiText[], options?: GuiTooltipOptions): Promise<GuiLayer[]>;
1879
1950
  static inventorySlot(slot: number | [number, number], origin?: [number, number], offset?: [number, number], rowSize?: number): [number, number];
1880
1951
  /** Creates crafting-table layers for ingredients and the result; stack counts are not drawn. */
1881
1952
  static recipe(recipe: GuiRecipe, options?: GuiRecipeOptions): GuiLayer[];
1882
1953
  }
1954
+ interface GuiTooltipOptions extends GuiTextOptions {
1955
+ /** Top-left text position, inside the tooltip's padding. */
1956
+ position?: [number, number];
1957
+ /** Extra space after the title, in pixels. Defaults to 2. */
1958
+ titleGap?: number;
1959
+ }
1883
1960
  type GuiRecipeIngredientValue = string | {
1884
1961
  item: string;
1885
1962
  } | {
@@ -2449,4 +2526,4 @@ declare class BrowserCache extends PersistentCache<LocalForage> {
2449
2526
  */
2450
2527
  declare function probeImageSize(data: Uint8Array): ImageSizeInfo;
2451
2528
 
2452
- export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, ArchiveAssetSource, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type Block, BlockEntities, type BlockEntityEntry, type BlockEntityIndex, type BlockEntityPart, type BlockEntityRotation, type BlockFluidState, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, BlockStateResolver, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, BrowserCache, BrowserEnv, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, Colormaps, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, ENTITY_ANIMATION_CHANNELS, type ElementFace, type ElementRotation, Entities, type EntityAnimation, type EntityAnimationBone, type EntityAnimationChannel, type EntityAnimationFile, type EntityAnimationKeyframe, type EntityAnimationOptions, EntityAnimationPlayer, type EntityAnimationPose, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, type EntityModelPass, EntityObject, type EntityObjectOptions, type EntityRenderMode, type EntityTransformOp, Env, type EnvProvider, type ExtractableImageData, type FluidKind, FluidModelObject, type FluidSample, type FluidSampler, type FrameCallback, type FromTo, Geometries, GuiHelper, type GuiItemLayer, type GuiLayer, GuiLight, GuiObject, type GuiObjectOptions, type GuiRecipe, type GuiRecipeIngredient, type GuiRecipeOptions, type GuiSpriteScaling, type GuiTextureLayer, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ItemTintColor, type ItemTintSource, ItemTints, type ListAsset, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MineRenderWorldOptions, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, ModelCulling, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockEntity, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, OrbitControls, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererFrame, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResolvedBlockEntity, type ResponseParser, SKIN_PARTS, SceneExporter, type SceneGLTFExportOptions, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, type SpecialItemPart, type SpecialItemRenderer, SpecialItems, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createFluidGeometry, createGuiTextureGeometry, createImage, entityAnimationTime, estimateBytesUsed, getBlockFluidState, getFluidKind, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isGuiObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, probeImageSize, registerBrowserEnv, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };
2529
+ export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, ArchiveAssetSource, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type BitmapFont, type BitmapGlyph, type Block, BlockEntities, type BlockEntityEntry, type BlockEntityIndex, type BlockEntityPart, type BlockEntityRotation, type BlockFluidState, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, BlockStateResolver, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, BrowserCache, BrowserEnv, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, Colormaps, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, ENTITY_ANIMATION_CHANNELS, type ElementFace, type ElementRotation, Entities, type EntityAnimation, type EntityAnimationBone, type EntityAnimationChannel, type EntityAnimationFile, type EntityAnimationKeyframe, type EntityAnimationOptions, EntityAnimationPlayer, type EntityAnimationPose, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, type EntityModelPass, EntityObject, type EntityObjectOptions, type EntityRenderMode, type EntityTransformOp, Env, type EnvProvider, type ExtractableImageData, type FluidKind, FluidModelObject, type FluidSample, type FluidSampler, Fonts, type FrameCallback, type FromTo, Geometries, GuiHelper, type GuiItemLayer, type GuiLayer, GuiLight, GuiObject, type GuiObjectOptions, type GuiRecipe, type GuiRecipeIngredient, type GuiRecipeOptions, type GuiSpriteScaling, type GuiText, type GuiTextLayer, type GuiTextLayout, type GuiTextOptions, type GuiTextRun, type GuiTextStyle, type GuiTextureLayer, type GuiTooltipOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ItemTintColor, type ItemTintSource, ItemTints, type ListAsset, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MineRenderWorldOptions, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, ModelCulling, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockEntity, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, OrbitControls, PersistentCache, type PositionedGuiGlyph, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererFrame, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResolvedBlockEntity, type ResponseParser, SKIN_PARTS, SceneExporter, type SceneGLTFExportOptions, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, type SpecialItemPart, type SpecialItemRenderer, SpecialItems, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createFluidGeometry, createGuiTextGeometry, createGuiTextureGeometry, createImage, entityAnimationTime, estimateBytesUsed, getBlockFluidState, getFluidKind, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isGuiObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, layoutGuiText, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, probeImageSize, registerBrowserEnv, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };