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

Get help using Construct 2

Post » Tue Aug 16, 2016 8:51 am

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?

Thanks!
B
23
S
5
G
1
Posts: 336
Reputation: 2,408

Post » Tue Aug 16, 2016 8:57 am

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.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,319
Reputation: 87,487

Post » Tue Aug 16, 2016 9:10 am

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)
B
23
S
5
G
1
Posts: 336
Reputation: 2,408

Post » Tue Aug 16, 2016 9:22 am

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 !
B
23
S
5
G
1
Posts: 336
Reputation: 2,408


Return to How do I....?

Who is online

Users browsing this forum: justifun, marcinkowski, wizdigitech, Yahoo [Bot] and 10 guests