Jump to content

How to scale a sprite inside a scaling container to a different scale value of the container?


caymanbruce
 Share

Recommended Posts

Hi everyone sorry for the "tongue-twisted" title.

I am making a player sprite inside a container and it works like this:

when I move my player sprite on some occasions such as the sprite touches some other sprites on the container, the container scales smaller but the player sprite will scale bigger. 

However what I get for now is the player sprite will scale with its container. If the container becomes smaller the player sprite will become smaller too. Whatever scale I use on the sprite is useless. Is there anything I can do to change to what I want? Do I need to move the player sprite out of the container? If I do this their relative positions are hard to observe. Can somebody point out a direction for me please?

Link to comment
Share on other sites

The sprite's scale isn't useless. Both scales are applied. So for instance if you set the container's scale to 0.5 and set the sprite's scale to 2, then the sprite will maintain its size. And if you wanted the sprite to be 3 times its original size, then you'd set its scale to 6 (since 3 / 0.5 = 6 ).

Link to comment
Share on other sites

11 hours ago, Taz said:

The sprite's scale isn't useless. Both scales are applied. So for instance if you set the container's scale to 0.5 and set the sprite's scale to 2, then the sprite will maintain its size. And if you wanted the sprite to be 3 times its original size, then you'd set its scale to 6 (since 3 / 0.5 = 6 ).

This works! Thank you. Now my problem is that the texture becomes a bigger ugly pixelated texture after scaling like I said in another thread.

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.

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...