image sprite transparent part cut?

292 views
Skip to first unread message

Muzaffer Kadir Yılmaz

unread,
Feb 16, 2017, 7:39:22 PM2/16/17
to MIT App Inventor Forum
hello everyone i am making a game but i have got a problem i wanna cut my imagesprite like png photos no transparent part i hope explained but all imagesprite is rectangular in appinventor. ihope you understand sorry my bad English.

SteveJG

unread,
Feb 16, 2017, 9:01:38 PM2/16/17
to MIT App Inventor Forum
Yes, ImageSprites display a rectangular image.  Developers can use an image manipulation program like the free Gimp 2  to set the background for the png to the same color as the background of the Canvas or change the image's transparency setting.  This will make the sprite appear to be a shape different from a rectangler.  The 'shape' of the sprite will still be square or rectangular.  If you use a transparent oval sprite it will behave like the rectangle.

Regards
Steve

Muzaffer Kadir Yılmaz

unread,
Feb 17, 2017, 6:03:45 PM2/17/17
to MIT App Inventor Forum
i don't understand can you explain via sending aia file ?

SteveJG

unread,
Feb 17, 2017, 7:13:17 PM2/17/17
to MIT App Inventor Forum
Explaining how to set the background of a png image is beyond the scope of this form...here is on explanation https://docs.gimp.org/en/gimp-using-web-transparency.html  You can make your own image of the catcher using the free GIMP software and set the background to transparent.  

Here is an example showing two sprites.  These are png images of an arrow.   One image has a transparent background, the other does not.  Can you tell from looking at the images?



There is no aia.   Attached are two images, one with a transparent background, the other without you can use for experimenting.

To understand the difference,  download the two png images and use them in sprites in your project and see the difference.  The images look like they have no borders, in reality each is 48 x 48 pixel square image.  BOTH behave like squares although one displays as if it has no boarder when displayed on a colored background.   If your Canvas background is set to white, you will see no difference.  Now do you understand why you can make the image look different than a square but the object  will always behave like a square ..that is because of how the Canvas works.

down.png
left.png
Reply all
Reply to author
Forward
0 new messages