Jump to content

Sprite2D is there a way to get the scaled size ?

Recommended Posts



I was wondering if actualSize was intended to give the size after scaling ?

Is there a way to get the actualSize after scaling ?


For now im using this :

var spriteSize = new BABYLON.Vector2(sprite.size.width, sprite.size.height);
var scaledSpriteSize = spriteSize.scaleInPlace(sprite.scale);


It would be nice to have access to the original size, and the scaled size in separate properties...


Also, I was wondering what you think about making vector2 and size function compatible, meaning Vector2.subtract(Size) would work... some kind of abstraction object that transforms every vector/size into a true vector of the same dimension but without the unit (x, width etc...). This would allow for a more fluid development, no @Deltakosh @Nockawa ?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...