Sprite native size

Hi!

I have an issue with my UI sprite frames.

Let’s say I have a UI node with a Sprite component on it. My sprite size is 98x101. UITransform size is 98x101 as well

At some point I want to change the UI node sprite with code. But the UI node is still 98x101

Unity has a function called “set native size”. Does Cocos have something like that?

node.getComponent(UITransform).setContentSize(new Size(width,height))

like this?

Hi!
Yeah that’s make sense
But how can I check native size of my spriteframe?

node.getComponent(cc.Sprite).spriteFrame.originalSize
You mean this?