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 - storm33229

Pages: [1]
1
Support / Re: Are there any issues with NGUI + 2D Toolkit together?
« on: May 02, 2013, 06:53:51 pm »
Perfect. Thanks :)

2
Support / Are there any issues with NGUI + 2D Toolkit together?
« on: May 02, 2013, 02:57:42 pm »
Before I start down this road, I want to make sure there aren't any issues, so... Are there any issues with NGUI + 2D Toolkit together? I am already accustomed to NGUI for... GUI... but I want to keep using 2D Toolkit for all of my non-GUI game elements. Will this be a problem?

3
That sounds good to me. I'll look at it whenever you're ready.  :)

4
Support / encapsulating the tk2dStaticSpriteBatcher commit behavior
« on: March 14, 2012, 12:36:19 am »
Here's a snippet from the editor script:

Code: [Select]
if (batcher.batchedSprites == null || batcher.batchedSprites.Length == 0)
{
if (GUILayout.Button("Commit"))
{
                batcher.Commit();
EditorUtility.SetDirty(target);
}
}

Then there's the actual code inside the tk2dStaticSpriteBatcher script:

Code: [Select]
    public void Commit()
    {
        List<tk2dSprite> sprites = new List<tk2dSprite>();
        tk2dSpriteCollectionData scd = null;

        for (int i = 0; i < this.transform.childCount; ++i)
        {
            Transform t = this.transform.GetChild(i);
            tk2dSprite s = t.GetComponent<tk2dSprite>();
            if (s)
            {
                if (scd == null) scd = s.collection;
                if (scd != s.collection)
                {
                    Debug.LogError("Error: Multiple sprite collections found");
                    return;
                }

                if (scd.allowMultipleAtlases)
                {
                    Debug.LogError("Error: Sprite collections with multiple atlases not allowed");
                    return;
                }

                sprites.Add(s);
            }
        }

        // sort sprites, smaller to larger z
        sprites.Sort((a, b) => b.transform.localPosition.z.CompareTo(a.transform.localPosition.z));

        if (sprites.Count == 0)
        {
            Debug.LogError("Error: No child sprite objects found");
            return;
        }

        this.spriteCollection = scd;
        this.batchedSprites = new tk2dBatchedSprite[sprites.Count];
        int currBatchedSprite = 0;
        foreach (var s in sprites)
        {
            tk2dBatchedSprite bs = new tk2dBatchedSprite();

            bs.name = s.gameObject.name;
            bs.color = s.color;
            bs.localScale = new Vector3(s.scale.x * s.transform.localScale.x, s.scale.y * s.transform.localScale.y, s.scale.z * s.transform.localScale.z);
            bs.position = s.transform.localPosition;
            bs.rotation = s.transform.localRotation;
            bs.spriteId = s.spriteId;
            bs.alwaysPixelPerfect = s.pixelPerfect;

            this.batchedSprites[currBatchedSprite++] = bs;

            GameObject.DestroyImmediate(s.gameObject);
        }

        this.Build();
    }

This was useful for me because at editor-time I was able to auto-batch my tile layers instead of clicking "Commit" for each one.

5
Support / Re: What next?
« on: March 12, 2012, 04:28:23 pm »
  • Integrated multi platform support (different atlases for different platforms, automatically loaded in)
  • Animation editor upgrade (this is long overdue in my opinion, but generally, our workflow fits quite well with the way it is right now)

A nice, artist friendly, animation editor would be awesome!

Seconded. Even as a programmer, the guess-and-check numeric index system is not ideal. I have a recommendation as to how it may look too: http://docs.garagegames.com/tgb/official/content/documentation/Tutorials/Feature/images/AnimatedSpritesFigure8.jpg

That is a picture of GarageGame's Animation Builder inside of Torque2D. I've used this before and it was really easy to construct the animations.

6
Support / Re: tk2dCamera with my Tile map.
« on: March 11, 2012, 10:40:59 pm »
I use Tiled. I wrote a C# conversion to deserialize the XML into an object model which is in turn used in conjunction with 2D Toolkit to generate the maps at editor-time. I actually don't use Unity for anything other than rendering and game logic; all the world design is done in Tiled.

7
Support / Re: tk2dCamera with my Tile map.
« on: March 11, 2012, 09:39:28 pm »
Oh everything seems to be working just fine. The coordinate system is x-right, y-up. I was just wanting to make x-right y-down. The anchors were not wrong on the camera, they were wrong on the sprite sheets inside the sprite collections.

8
Support / Re: tk2dCamera with my Tile map.
« on: March 11, 2012, 09:18:18 pm »
The images I attached are using SpriteCollection's which have 'Use tk2d Camera' set to true.

When I place the sprite at (0, 0) it does not appear, but when I move it up a bit then it starts to show. It looks like the sprites are drawing from the top-left and not the bottom-left?

In fact, that is what was happening. I just changed my Sprite Collection's Sprite Sheet's Anchor to Lower-Left instead of Upper-Left, and now the entire first row of the tile map shows.

I suppose I could rewrite my game logic and map creation code to work with positive-only y positions instead of negative-only y positions. I just would love to have an option for which way the camera behaves.

9
Support / tk2dCamera with my Tile map.
« on: March 11, 2012, 06:41:31 pm »
I have attached two images that depict the problem I am having. What I would like to do is:

Set my camera to (0, 0, -10) and have it draw from the top-left down and to the right, such that it draws x pixels to the right and y pixels to the down directions. Right now, if  I set both my objects and camera to (0, 0) nothing gets seen on the game window.

Let me know if you  need more info.

Pages: [1]