How to type cast cc.Texture2d to cc.SpriteFrame or vise versa?

how to type cast cc.Texture2d to cc.SpriteFrame or vise versa in cocos creator?

any one?..
how do i make a SpriteFrame out of a Texture2d

Best practice depends on where you get your Texture2D from, but you can always go with a simple

var spriteFrame = new cc.SpriteFrame(texture);
1 Like

Thank you!!!
i find it endless days…