Jump to content

Please help me Thanks!!!


Recommended Posts

Hello everyone

i have a problem....

i want to put many texes into a same tex and the tex will be cuted by the xml

like this:

20160606162330.png

but i dont know what tools i need

who has the tool?

thanks thanks thanks....

Link to comment
Share on other sites

Its actually quite easy....

On the xml file that references your .tex you will want something like something like this:

===
<Atlas>
<Texture filename="<yourfilename>.tex" />
   <Elements>
       <Element name="<item1name>.tex" u1="0.0010256" u2="0.0663212" v1="0.0021978" v2="0.1428571" />
       <Element name="<item2name>.tex" u1="0.0676923" u2="0.1333333" v1="0.1450549" v2="0.2857143" />
-- etc. etc.
   </Elements>
</Atlas>
===

But, what do those numbers mean?

Well, they are coordinates of the four corners of your .tex icon within the larger image
They are expressed as a percentage of the entire image size.
So if the image is 975 pixels wide, the icon in the upper left would start at horizontal coordinates 1/975 and end at 64/975
And then repeat the math for the vertical coordinates, based on the height of your image.
Measurement and placement of the images is very important, and I think the larger image has to maintain a certain aspect ratio -
unfortunately it has been a long time since I made images in that way
I forget which coordinate is which corner - I think V are the vertical, but it may start measuring from the bottom, so .001 would be the bottom row.
( You can check the core game's Inventoryimages.xml to try to figure out which coordinate is which by matching up a known icon with a known name within the xml file )

Anyway, its quite a bit of mathwork to make it work, but it can be done.
If I remember right, however, the game (or early versions of it) would try to overwrite the xml document whenever I would recompile my mod.
So after compiling I would then manually replace the new xml with one I had saved.
That may no longer be the case.

Hope that helps,
Why not make each image a separate .tex and xml?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...