简体   繁体   中英

Split parameter in a texture atlas file?

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.

Here is a example files:

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

I hope this image could solve your problems!

a , b , c , and d are the 4 parameters

拆分参数视觉信息

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 .)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM