Jump to content

Is it possible to scale a sprite, and have that new size be set as scale 1?


Recommended Posts

Hi all

I've been making a game with lots of sprites which use high resolution textures.

I am hoping to give the option to replace these textures with lower quality ones for performance benefits. I would have to scale them up (half assets to scale * 2).
However, there are times when I tween the scales on sprites. (tweening to scale 1.5 would have made a sprite larger, it would now make it smaller)

A quick way of solving this would be to scale the sprite straight away, and then lock that as the default scale (1) so I wouldn't have to make a large amount of changes.

Is this possible? I would prefer to not scale up the textures themselves, as I believe this would have the same performance as using the high resolution textures in the first place. 

Link to comment
Share on other sites

You can use different texture resolution. When you load an image with name like "@.5x.png", pixi detects it automatically. Same for spritesheets made with different packers. Resolution does not affect real size of elements, like if you have 32x32 at resolution 0.5, its the same as 64x64. There are many places where pixi accepts resolution as a parameter, and so far i didnt see complete tutorial on that, you have to study the docs and source code.

Link to comment
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...