0 Favourites

How do I avoid size problems when replacing an object image?

  • Hi everyone,

    There is a problem that I encounter very often when I'm replacing a sprite's image with another one which has a different size.

    If I resized the initial image in the editor, I can't manage to have the updated sprite (the same sprite with a different image) at the right size. This happens even though I manually entered correct size in the properties.

    So to be more clear:

    • I used a very small (10x10 px) image for the sprite Object (eventually I resized it in the editor?)
    • Now I want to use a bigger image (50x50 px) , I replace it in the edit image window.
    • When previewing, it is my new image but resized so that it has the size of the previous version of Object (very small)
    • The sizes in Edit Image window and Properties panel are correct!
    • It looks like after going to another layout and coming back, the images have a correct size. However, the first time the layout is reached, the size is always wrong.

    I can't manage to give Object its correct updated size consistently. Is there a solution, or should I duplicate Object in order to create a new object and update my code?


  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • You need/should click the "Make 1:1" link in the Size property at the bottom in the properties bar for the sprite.

    This will put back the sprite to the size of the texture itself, forgetting about the resizing within C2's editor.

  • Thanks a lot for the fast reply, Kyatric. But I'm afraid it doesn't fix the problem. :/

    When the objects on the layout are destroyed then are created again, their size is then normal. But the objects which are present on the layout upon loading are still very small. (While their size on the layout in the editor is correct, it only happens in the preview)

  • Sorry, I solved the problem. The object wasn't displayed correctly due to the cache of the browser. Switching to another browser makes it appear correctly and your answer is thus everything I need !

    Thanks a lot !

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
99 10,152
karshinkoff's avatar
Unread hot topic
167 14,513
DMT2005's avatar
Unread hot topic
123 14,873
Zebbi's avatar