1.1.1 2D预览模板 2D Preview Template

此为2D Res Inscriptions铭刻的展示模版,此模版为模版范例参考,可以直接使用,也可以对其源码进行修改自定义,或者根据自己需要重新编写新的模版并且上链。

此模版铭刻脚本链上inscription为

5d1bc794cc8a7e2c0c1b104f5c10f5319b68796ac57eba02fe39b10761334192i0

可以查看其相关源码Source code。亦可以直接引用。相关规则在下方介绍

范例Example:

我们以 2D Res Inscriptions 的最后一个动画资源为例,详细说明此2D Preview Template的属性说明:

<metaverse 
	name="CuteDoge"
	description="This is a cute dog with animation, you can use it anywhere"
	src = "/content/4acc4304ab4b62855ad8540c4effd6f70410ce3gg50e7886109ad985dc2ba2642"
	srctype="PNG"
	issheetanimate="true"
	sheetlayout="[8,5]"
>
	<animate name="idle-down" range="[0, 0]" duration="0.9" />
    	<animate name="idle-up" range="[1, 1]" duration="0.9" />
    	<animate name="idle-right" range="[2, 2]" duration="0.9" />
	<animate name="idle-left" range="[3, 3]" duration="0.9" />
	<animate name="move-right" range="[8, 15]" duration="0.9" />
    	<animate name="move-up" range="[16, 23]" duration="0.9" />
    	<animate name="move-down" range="[24, 31]" duration="0.9" />
	<animate name="move-left" range="[32, 39]" duration="0.9" />
</metaverse>

<metaversepreview
	backgroundcolor="0b9db7"
	>
	<previewimg 
		src="/content/4acc4304ab4b62855ad8540c4effd6f70410ce3gg50e7886109ad985dc2ba2642"
		issheetanimate="true"
		sheetlayout="[8,5]"
		sheetindex="14"
	/>
	<previewimg 
		src="/content/6f7c28ce0f87f498ab4be1dc4e498c206b85a2646285609fd4392i0178090cf70d"
	/>
	<previewimg 
		src="/content/2c777cc0756d5bb198153cdde9f00c779edi0ef0594ffa692ec18c4e5522a40c12"
		size="[1,1]"
		position="[0.5,0.25]"
	/>
	<previewimg 
		src="/content/1d98ab4bc17826462e8786f7c28806b5609fd4392i0090cf70df45ace0f4e498c2"
		size="[0.4,0.4]"
		position="[0.8,0.8]"
		rotation="-30"
	/>
</metaversepreview>
<script  src="/content/5d1bc794cc8a7e2c0c1b104f5c10f5319b68796ac57eba02fe39b10761334192i0"></script>

预览展示相关属性被包含在<metaversepreview>相关区块属性之中

其中单项基础属性填写在"<metaversepreview" 与 ">" 之间,以空格或者换行隔开。

多项重复属性(递归图片叠加)填写在<metaversepreview ... >" 与 "</metaversepreview>" 之间,每一个递归叠加的图片按照顺序绘制在展示图片上。后面的覆盖前面的previewimg

单项基础属性:

key
Required?
Description

backgroundcolor

No

背景颜色,默认为“ffffff” 纯白色

other keys you want

No

如果你使用自己的模板脚本,你可以自定人任何你写的script中所要引用的相关key属性。

多项属性previewimg :

这些示例中使用的图像资源实际上并未放置在区块链上,列出的地址是虚构的。请手动上传您需要引用的任何递归图像资源。

这里我们使用的三张已经上链的资源图片作为预览展示的递归图拼装展示,他们分别为下面3张图:

2c777cc0756d5bb198153cdde9f00c779edi0ef0594ffa692ec18c4e5522a40c12
1d98ab4bc17826462e8786f7c28806b5609fd4392i0090cf70df45ace0f4e498c2

其递归图片属性写在"<previewimg" 以及 "/>"之间 以空格或者换行隔开

src

Yes

递归图链上地址

size

No

递归图片缩放大小 默认为[1,1]

positon

No

递归图片默认位置,默认为[0.5,0.5]

rotation

No

递归图片默认旋转,数值范围为0-360,默认为0

isatlas

No

是否是图集

atlasrange

No

此属性为标注图集中的一个区域,[x,y,z,w] x,y: 为划分图引用区域起始的像素坐标 z,w:为改区域的长宽值。 具体见2D Res Inscriptions中atlas属性key

issheet

No

是否等距sheet划分的图集

sheetlayout

No

sheet的横竖tiling 划分[x,y] x : 横向数量 y : 纵向数量

sheetindex

No

sheet图集的展示图片index序号

Last updated