Jump to content

Texture aspect ratio


Recommended Posts

8 minutes ago, ivan.popelyshev said:

pixijs doesnt have any resizing options to preserve aspect ratio. Usual stuff, after you load texture, just take "min(scale.x, scale.y)" and assign it to object scale.

Thanks for the reply ivan. Do you mind writing a code snippet on how do i got about it? 

Link to post
Share on other sites

Here you go: https://codepen.io/ivanpopelyshev/pen/NWRPLOy

in 4.4.5 you had to do something like that use use pixi loader. in v5 you can do the following to wait for it to load: https://www.pixiplayground.com/#/edit/9z1BH9bfLlwwX4DGcn_N0

Edited by ivan.popelyshev
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.

Guest
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.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...