在纹理图集文件中分割参数? [英] Split parameter in a texture atlas file?
问题描述
skin.atlas
文件中的split
参数的工作方式.我相信Libgdx
纹理打包程序是从9-patches
创建这些的.我有时需要手动添加这些(当在链接的标签中使用texturepacker时,或在手动插入/编辑纹理时),似乎无法弄清楚它们是如何工作的.有时一个像素会使我的元素消失或无法填充拆分.
How exactly works the split
parameter in a skin.atlas
file. Libgdx
texture packer creates these from 9-patches
I believe. I need to manually add these sometimes (when using the texturepacker in the linked tag or when manually inserting/editing a texture) and cant seem to figure it out how they exactly work. Sometimes a single pixel makes my elements disappear or does not fill the split.
这是一个示例文件:
roundtext138.png
format: RGBA8888
filter: Nearest,Nearest
repeat: none
button
rotate: false
xy: 0, 0
size: 46, 46
split: 22, 22, 22, 22
orig: 46, 46
offset: 0, 0
index: -1
推荐答案
Libgdx纹理打包器应该从.9.png
文件中的元数据生成您在图集中看到的split/padding参数.这些数字表示可拉伸区域(9元素网格的中间部分)的startX, endX, startY, endY
.参见在TexturePacker.java中.)
The Libgdx texture packer should generate the split/padding parameters you see in the atlas from the metadata in the .9.png
file. Those numbers represent the startX, endX, startY, endY
of the stretchable area (the middle section of the 9-element grid). See the source code that generates the splits
array for more details. (You can see the splits information being written out to the atlas in TexturePacker.java.)
这篇关于在纹理图集文件中分割参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!