-
Notifications
You must be signed in to change notification settings - Fork 2
images
navigation: title: Images parent: index.md position: 145 icon: minecraft:wool:1 categories:
- widgets
<FloatingImage>, <ItemImage>, and <BlockImage> rendering tests.
Relative path (test1.png in the same directory):

Inline image mixed with text: here
is an inline image.
<FloatingImage> now crops first and scales second. x, y, width / w, and height / h select the
source rectangle on the original image. scaleX and scaleY then resize that cropped result, including
single-axis stretching.
Cropped 64×64 region displayed at native size:
Cropped 64×64 region stretched to 200×80:
Cross-mod texture with true inline placement:
Text before text after.
<ImageAnnotation> children attach hover tooltips (and optional colored borders) to rectangular
regions of a <FloatingImage>. Coordinates (x, y, w, h) are in cropped-image pixels; the
region is automatically scaled when the cropped image is resized or stretched. Omitting all four covers the
entire image.
Whole-image annotation (hover anywhere over the image to see the tooltip):
This tooltip appears when you hover over **any part** of the image.Region annotation with a visible red border (x=10, y=10, w=60, h=40):
Hovering the **red-bordered region** shows this tooltip.Multiple annotations on one image — each region shows a different tooltip:
Left half Right halfScaled crop with an annotation that follows the stretch:
Entire cropped region after stretching.Click the image or the left region to play a custom sound. Hover the right region to play a hover
sound. The example declares the event ids in the resource pack's assets/guidenh/sounds.json;
actual .ogg files should be placed below assets/guidenh/sounds/.
&Inline sound action
**Rich text sound link** This annotation has both a tooltip and a click sound.Inline <ItemImage> icons are nudged upward by ~4 pixels (scaled by scale) so their visual center lines up with the surrounding text baseline. The label text receives a separate, smaller default nudge (-2 px). Both can be overridden independently.
- Default offset (-4px icon, -3px label): this line mixes diamond, apple and iron ingot.
- Disabled icon offset (
yOffset="0", label unchanged): diamond, apple. - Disabled label offset (
labelYOffset="0", icon unchanged): diamond, apple. - Both offsets zeroed (
yOffset="0" labelYOffset="0"): diamond, apple.
Values are pixels at
scale=1and are multiplied by the current scale at render time.
Label to the right (default italic name):
Label to the left:
Bold format with %s placeholder:
Strikethrough format:
Underline (using __):
Wavy underline:
Dotted underline:
Icon hidden, label only:
Icon shown, no tooltip:
BlockImage now renders a transparent 3D placed-block preview rather than an item-form icon.
Basic link (text only, tooltip enabled):
Icon to the left of the link text:
Icon to the right, tooltip suppressed:
Ore-dictionary lookup:
Explicit link target with anchor:
Same-page anchor link: