Skip to content

Compass XML

KilaBash edited this page Jul 31, 2023 · 9 revisions

We will breifly inllustrates labels in the xml.

generic attributes

<page>
  <xxx top-margin="10" bottom-margin="10">
  <!--margin is a generic property that represents the amount of space reserved between the previous component and the next component. The default is 0.-->
  </xxx>
</page>

Header

<page>
    <h1>Title H1 <lang key="ldlib.author"/></h1> <!-- label <lang/> can be used to load text according to the lang key -->
    <h2>Title H2</h2>
    <h3>Title H3</h3>
    <!-- attributes-->
    <h1 space="2" font-size="9" isCenter="false" isShadow="true"> <!-- space: row spacing-->
</page>

Blank

<page>
    <br height="20"/> <!--blank height-->
</page>

Text

<page>
    <text>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit,
        <style underlined="true" link="ldlib:test_node2">
            link to node2
        </style>
        sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
        <style color="#ffff0000" hover-info="hover tooltips">
            Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
            ut aliquip ex ea commodo consequat.
        </style>
        <br/>
        Duis aute irure dolor in reprehenderit
        in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
    </text>
    <!-- attributes-->
    <text space="2" isCenter="false">
        <br/> <!--new line-->
        <lang key="ldlib.author"/> <!-- used to load text according to the lang key -->
        <style color="#ffffffff" bold="false" italic="false" underlined="false" strikethrough="false" obfuscated="false"> 
            <!--The style of the text in the range-->
        </style>
        <style hover-info="hover tooltips" link="ldlib:my_node_2"> 
            <!--link will jump to the given node while click-->
        </style>
    </text>
</page>

Image

<page>
    <image width="160" height="40" type="resource" top-margin="10" bottom-margin="10" url="gtceu:textures/gt_logo_long.png" hover-info="tooltips">
        <!-- same as the text label here -->
        description of the image.
    </image>
    <image width="100" height="100" type="item" item="minecraft:stone"/>
</page>

Recipe

<page>
    <recipe id="minecraft:barrel"/> <!--recipe id-->
</page>

Ingredient

<page>
    <ingredient>
	<item item="minecraft:stick" count="3"/>
	<item tag="minecraft:ores" forge-tag="forge:ores/gold" fabric-tag="c:ores/gold" count="64"/>
	<fluid fluid="minecraft:lava" count="64000"/>
    </ingredient>
</page>

Scene

<page>
    <scene height="300"> <!-- draggable="false" scalable="false" zoom="6" camera="perspective" can also be set here-->
	<page>
	    <block pos="0 0 0" block="minecraft:glass"/>
	    <block pos="1 0 0" block="minecraft:dirt" item-tips="true"/>
	    <block pos="0 0 1" block="minecraft:furnace">hover info</block>
	</page>
         <page>
	    <block pos="0 0 0" block="minecraft:redstone"/>
	    <block pos="1 0 0" block="minecraft:wool" item-tips="true"/>
	    <block pos="0 0 1" block="minecraft:grass">hover info</block>
	</page>
    </scene>
</page>

Compass

<page>
    <compass> <!-- scene="true" height="250" zoom="6" can also be set here-->
        <!-- Frames divide the animation into different parts, similar to how the animation is segmented in a ponder. Frames are executed sequentially.-->
        <frame> <!-- duration="-1" delay="0"-->
            <description>
                <!-- Describes the frame, shows it on hovertooltips, and has the same syntax as the text label-->
		section 1.
	    </description>
            <!--actions-->
            <!--Actions are executed sequentially, and the next action is executed if and only if the last action is completed, but this can be adjusted using the following attributes, similar to ppt animation.
                delay="0"  --- 
                start-before-last="false"
            -->

            <!--Action information: display text and images on top-->
            <information type="item" url="minecraft:apple">
		<style bold="true" color="#ffff0000"><lang key="ldlib.author"/></style>
	    </information>

           <!--Action scene: Animate the scene. Notice that all the operations under the <scene/> are happening simultaneously. More than one <scene/> label should be used when the operation is sequential-->
           <scene start-before-last="true">
                <!--add block to the scene with animation-->
		<add pos="0 0 0" block="minecraft:glass"/>
                <!--add block with properties-->
                <add pos="1 1 0" block="minecraft:campfire">
                    <properties name="lit" value="false"/>
                </add>
                <!--add block with nbt for blockentity-->
                <add pos="3 0 1" block="minecraft:chest">
                    <nbt>
                        {
                            Items: [
                                {
                                    Count: 63b,
                                    Slot: 0b,
                                    id: "minecraft:coal_block"
                                }
                            ]
                        }
                    </nbt>
                </add>
		<add pos="0 1 0" offset="3 1 0" duration="40" block="minecraft:glass"/> 
                <!--offset: animation offset, duration: animation duration-->
	   </scene>
           <scene>
                <!--modfy a block, its kinda similar to the add label but without animation -->
		<modfy pos="1 1 0" block="minecraft:campfire">
                    <properties name="lit" value="true"/>
                </modfy >
	   </scene>
           <scene>
                <!--remove block from the scene with animation-->
		<remove pos="0 0 0" offset="3 1 0" duration="40"/>
	   </scene>
           <scene>
                <!--Point to a location in the scene and provide a description-->
		<tooltip pos="1.5 1.5 0.5" screen-offset="0.6 0.5" duration = "60" item="minecraft:flint_and_steel">
                    <!--pos: position in the scene, screen-offset: description positon in the compass view-->
                    lit = <style color="0xff00ff00">true</style>
                </tooltip>
	   </scene>
           <scene>
                <!--hightlight a block or a face of the block-->
		<highlight pos="0 0 0" duration="70"/>
                <highlight pos="0 0 0" face="UP" duration="70"/>
	   </scene>
           <scene>
                <!--rotate the scene view-->
		<rotation degree="90"/>
	   </scene>
        </frame>
    </compass>
</page>