Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - breeves

Pages: [1]
1
Support / Re: unable to commit sprite collection because of error
« on: September 03, 2013, 05:05:51 pm »
It's possible that I'm using a more recent version than 2.1, but that's the one that I have saved off on my back up drive. Is there an easy way to tell which version I have? When I go to the About menu item it just says that it's version 2, final. The loop in which it's breaking is:
Code: [Select]
for (int i = 0; i < atlasData[atlasIndex].entries.Length; ++i)
{
var entry = atlasData[atlasIndex].entries[i];
Texture2D source = textureList[entry.index];
                int spriteId = entry.index;
                tk2dSpriteCollectionDefinition.Pad padMode = gen.textureParams[entry.index].pad;
                Texture2D mask0 = GetMaskTexture(gen, source, 0, spriteId, padMode);
                Texture2D mask1 = GetMaskTexture(gen, source, 1, spriteId, padMode);
                Texture2D mask2 = GetMaskTexture(gen, source, 2, spriteId, padMode);
               
                if (!entry.flipped)
{
for (int y = 0; y < source.height; ++y)
{
for (int x = 0; x < source.width; ++x)
{
tex.SetPixel(entry.x + x, entry.y + y, source.GetPixel(x, y));
                            Color m = new Color(mask0 == null ? 0 : mask0.GetPixel(x, y).r, mask1 == null ? 0 : mask1.GetPixel(x, y).r, mask2 == null ? 0 : mask2.GetPixel(x, y).r);
                            maskTex.SetPixel(entry.x + x, entry.y + y, m);
}
}
}
else
{
for (int y = 0; y < source.height; ++y)
{
for (int x = 0; x < source.width; ++x)
{
tex.SetPixel(entry.x + y, entry.y + x, source.GetPixel(x, y));
                            Color m = new Color(mask0 == null ? 0 : mask0.GetPixel(x, y).r, mask1 == null ? 0 : mask1.GetPixel(x, y).r, mask2 == null ? 0 : mask2.GetPixel(x, y).r);
                            maskTex.SetPixel(entry.x + y, entry.y + x, m);
}
}
}
}

The line on which it's breaking is:
Code: [Select]
tk2dSpriteCollectionDefinition.Pad padMode = gen.textureParams[entry.index].pad;

2
Support / Re: unable to commit sprite collection because of error
« on: August 30, 2013, 02:45:28 pm »
I'm using 2.1.

3
Support / unable to commit sprite collection because of error
« on: August 29, 2013, 10:54:47 pm »
I have a sprite collection in which I was replacing an image. When I initially replaced the image I accidentally replaced with one that was much too large and immediately got an error telling me that the collection couldn't be committed because it exceeded the atlas size. I swapped it out with a new image but am now getting this error any time I try to commit:
IndexOutOfRangeException: Array index is out of range.
tk2dSpriteCollectionBuilder.Rebuild (.tk2dSpriteCollection gen) (at Assets/ThirdParty/TK2D/Editor/tk2d/Sprites/tk2dSpriteCollectionBuilder.cs:938)
tk2dSpriteCollectionEditorPopup.Commit () (at Assets/ThirdParty/TK2D/Editor/tk2d/Sprites/SpriteCollectionEditor/tk2dSpriteCollectionEditorPopup.cs:447)
tk2dSpriteCollectionEditorPopup.DrawToolbar () (at Assets/ThirdParty/TK2D/Editor/tk2d/Sprites/SpriteCollectionEditor/tk2dSpriteCollectionEditorPopup.cs:437)
tk2dSpriteCollectionEditorPopup.OnGUI () (at Assets/ThirdParty/TK2D/Editor/tk2d/Sprites/SpriteCollectionEditor/tk2dSpriteCollectionEditorPopup.cs:836)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Applications/buildAgent/work/84669f285f6a667f/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

Any help would be greatly appreciated.

4
Releases / Re: 2D Toolkit 1.90 beta 3
« on: January 27, 2013, 10:16:32 pm »
Thanks for letting me know, I've added a scrollbar to the list, and fixed the bug with spritesheet entries appearing multiple times - I've fixed it for 1.90 final which I'm putting together right now.

In almost all cases, you should NOT ignore that message. It means that the texture is in a directory called resources (eg. Assets/MyBigTexture/resources/anotherfolder/Elephant.png). Unity will automatically include that texture in the build, even if you don't use it. This means that the source images will be included in your final game, in addition to the atlases.
http://docs.unity3d.com/Documentation/ScriptReference/Resources.html
Your project is going to be a lot bigger than it should be.

To fix it, move the texture OUT of a resources directory.

Thanks, that worked great.

5
Releases / Re: 2D Toolkit 1.90 beta 3
« on: January 27, 2013, 09:19:22 pm »
Ever since upgrading to 1.9, I've been getting a warning screen every time I try to edit my sprite collection. "Warning: The following assets are in one or more resources directories. These files will be included in the build." I'm using a sprite sheet instead of pulling in separate images. For every tile in my sprite sheet there's an entry pointing to the base image and an "ok" button beneath them all. For smaller sprite sheets, I can get past the warning by expanding the window to see the ok button. With larger collections, however, I can't expand the window large enough to get to the button. It would be nice if I didn't get the warning, since I really don't understand what the warning is about or what I could do about it. If that's not an option, having the "ok" button at the top of the list would be very helpful.

Pages: [1]