2

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
asked Oct 5, 2014 at 14:29

2 Answers 2

2

I hope this image could solve your problems!

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

Split param visual info

Spikatrix
20.3k7 gold badges44 silver badges85 bronze badges
answered Apr 20, 2015 at 9:11
Sign up to request clarification or add additional context in comments.

Comments

1

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

answered Oct 6, 2014 at 6:10

2 Comments

Thanks. Im packing sometimes with a different tool that does not take 9 patches. And other times i paste elements in manually. I take its not possible to split the split so the center of a element will not stretch for some awesom button action :).
Also, endx is calculated from right end to right split right?

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.