Resizing image sprites

Hello. I am trying to place this picture:


to my canvas. (its background is empty) I want to place it at the right top but İ cannot, because the image has empty areas. So I cut them. But when I cut them, the original garderobe picture enlargens and looks weird on my screen. I dont want to change its height or width. Because I have other pictures; carpet, bed, etc. They font have this emptiness around them because I cut them in the shape of a square and their ratio didnt change.(I didnt change their height or width by code too.) But this time it doesnt work. Anyone know how to proceed?

Images in imagesprites are always rectangular, they cannot be any other shape, therefore if you have a transparent background the "edges" of your images will be the extent of the transparency.

What you could try is to place the canvas inside a vertical arrangement (centre/centre) then make the dimensions of the canvas larger than those of the vertical arrangement. You should then be able to place imagesprites nearer the edges of the viewable canvas.

but my canvas is already the size of the screen width :frowning:

Not an issue. Make the vertical arrangement screen width and the canvas wider and higher than that.

Here is an example

imagesInCanvas.aia (38.7 KB)

A clock is used to help the canvas size settings "catch up" with the sizing of the vertical arrangement.

Yes that works thank you soooo much!! One last question; this is actually going to be a presentation of a "room" for my "character" in the game so I am placing image sprites to the canvas, but I want it to look good on every screen size so I write codes according to that like this:


(you can see I added those last two blocks and the canvas' sizes are bigger now)
But with the garderobe I have to proceed as you said and set its coordinates outside the vertical arrangement. Do you have any recommendations about that?

You will have to take account of the extra canvas width and height and compensate for it (add or take away) in your positioning.

Thank you so much, you have helped me very much!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.