Author Topic: Use premade Spritesheet to create an Atlas  (Read 1400 times)

The-Arrival

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 29
    • View Profile
Use premade Spritesheet to create an Atlas
« on: April 28, 2016, 04:20:43 AM »
Hello,

i have a premade texture with several sprites from my artist and i try to figure out oh to set it up as a texture atlas. I pretty much know what i need to do, except the options seem not to be available in the Atlasmaker tool, so propably i´m missing something here.

using:
Unity 5.3.3f1
NGU 3.9.8
NGU HUD Text 1.13

Here are my steps so far:

i importet the png as a texture, alphaIsTransparency checked, WarpMode clamped and truecolor as suggested here: http://www.tasharen.com/?page_id=120

i opened the atlasMaker created a new Atlas and setup the material using this very texture. Now i have one sprite to map out which i did. As stated here i should be able to setup more sprites and positions for that texture but i cannot find the button for it: http://www.tasharen.com/forum/index.php?topic=221.msg1090#msg1090

Also i get a console error. All my Settings and the error are on the attached screenshot

I also read up that it´s possible to import the sprite-positions using a txt file generated from some tool. Is there another way to generate that file or can i get an example of the layout of such a txt, so i can write my own and use it?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: Use premade Spritesheet to create an Atlas
« Reply #1 on: April 29, 2016, 12:34:40 PM »
You should import the texture as type Advanced, read-write enabled, compression disabled (texture type RGBA32). NGUI tries to force all of those, but sometimes when you have explicit platform-based settings set, they overwrite whatever NGUI tries to do.

The best way to add sprites is the way you're doing -- just by using the Atlas Maker tool. You can import existing sprite sheets exported by tools like Sprite Packer if they're exported in TXT form.

The-Arrival

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 29
    • View Profile
Re: Use premade Spritesheet to create an Atlas
« Reply #2 on: May 07, 2016, 11:41:40 AM »
I still don´t find any button to add another sprite (or better another location/setting for a sprite) in the atlas maker.
 

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: Use premade Spritesheet to create an Atlas
« Reply #3 on: May 07, 2016, 11:38:02 PM »
Select any texture with the Atlas Maker open. You will see an Add button. It's covered in the tutorial.

The-Arrival

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 29
    • View Profile
Re: Use premade Spritesheet to create an Atlas
« Reply #4 on: May 15, 2016, 07:49:44 AM »
That way i´ll add another texture to the Atlas and to the spitesheet-texture, i know that. I was looking for a way to "Add" a sprites locationsetting when i allready have those sprites in my spritesheet-texture and i want to define manually their locations and spacing.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: Use premade Spritesheet to create an Atlas
« Reply #5 on: May 18, 2016, 04:38:41 AM »
There is no way to add an entire sprite sheet to an NGUI atlas. Keep in mind you can just use Unity's atlasing where it's trivial. Just use UI2DSprite to draw them instead of UISprite.