- Home /
Question by
emrys90 · Jul 23, 2014 at 06:10 AM ·
texture2dtexture-atlas
Texture2D.PackTextures Only Packing First Texture
As the subject says, it is only packing the first image. I have tried it with two different sets of images, same result.
Texture2D texture = new Texture2D(2048, 2048);
Rect[] rects = texture.PackTextures(textures, 2, 2048);
textures is a public array that I assign elements to in the inspector. I then draw the texture in OnGui, so that is how I know only one image is in there.
Comment
How are you populating the textures
array? Can the textures fit into a 2048x2048 size?
Dragging the image into an element in the inspector. One image is 1024x1024, the other is 512x512.
Changing the padding, the second parameter to PackTextures, to 0 fixed it. Both images are now in there.