Exemple #1
0
    void Awake()
    {
        play = TPackManager.getAtlas(Atlases.EXAMPLE).getPngTexture("play");

        //Warning to Get Texture2D from atlas, should remain the same size which was generated,
        //that's why we using another atlas here
        unityTexture = TPackManager.getAtlas(Atlases.EXAMPLE2).getUnityTexture("play");
    }
Exemple #2
0
    void OnGUI()
    {
        play.draw(new Rect(0, 0, play.width * 0.5f, play.height * 0.5f));

        play.draw(new Rect(0, 75, play.width, play.height));

        GUI.DrawTexture(new Rect(0, 225, unityTexture.width, unityTexture.height), unityTexture);


        TPAtlasTexture tex = TPackManager.getAtlas(Atlases.EXAMPLE).getPngTexture("f_share");

        tex.draw(new Rect(200, 0, 122, 42));


        TPackManager.getAtlas(Atlases.EXAMPLE).draw(new Rect(200, 100, 122, 42), "t_share.png");
    }
    void Awake()
    {
        anim       = TPGUIAnimation.Create();
        Scaledanim = TPGUIAnimation.Create();

        for (int i = 1; i < 7; i++)
        {
            TPAtlasTexture frame = TPackManager.getAtlas(Atlases.EXAMPLE).getPngTexture("fireball_000" + i.ToString());
            anim.addFrame(frame);
            Scaledanim.addFrame(frame);
        }

        anim.pos  = new Vector2(200, 200);
        anim.loop = true;
        anim.fps  = 25;
        anim.Play();

        Scaledanim.pos   = new Vector2(300, 200);
        Scaledanim.loop  = true;
        Scaledanim.fps   = 25;
        Scaledanim.scale = 0.5f;
        Scaledanim.Play();
    }
    //--------------------------------------
    // GET / SET
    //--------------------------------------


    private TPAtlas getAtlas(string atlasName)
    {
        string path = TPAtlasesData.getAtlasPath(atlasName);

        return(TPackManager.getAtlas(path));
    }
Exemple #5
0
    //--------------------------------------
    //  EVENTS
    //--------------------------------------

    //--------------------------------------
    //  PRIVATE METHODS
    //--------------------------------------



    private TPAtlasTexture GetAtlasTExture(int index)
    {
        TPFameInfo frame = frames[index];

        return(TPackManager.getAtlas(frame.atlasPath).getTexture(frame.textureName));
    }