Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / Sprite Border Problem

Author
Message
Uechi
17
Years of Service
User Offline
Joined: 2nd Sep 2006
Location:
Posted: 2nd Mar 2022 16:49
I broke an image into pieces using GetImage. I then took these pieces and created sprites which I loaded into a 21 by 21 grid, hoping the result would look like the original image but would be pieces I could manipulate.
The grid got created but there is a black border between each sprite vertically and horizontally. How can I get rid of these so it looks like the original image?
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 3rd Mar 2022 00:32
Is your spacing off when positioning them? Did you cut the image up properly?

If neither of those, then you might try this:

SetImageMinFilter( iImageIndex, mode )
mode - The filter mode to use, 0=nearest, 1=linear

Load your image and use this command on the image before assigning it to a sprite. (might work after assigning it but i'm not sure). Setting the filter to nearest may provide a sharper image at the edges if that is what's happening.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 3rd Mar 2022 01:07
SetImageMagFilter( iImageIndex, mode ) might also help
Uechi
17
Years of Service
User Offline
Joined: 2nd Sep 2006
Location:
Posted: 3rd Mar 2022 04:33
Thanks for the suggestions. They didnt work but I was able to fix the problem by making the area copied bigger than I needed and it merged the sprites fine with no spaces..
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 6th Mar 2022 06:45
Personally, I wouldn't use GetImage for that.
If the sprites are all the same size then use SetSpriteAnimation() and SetSpriteFrame().
If they are different sizes, create a subimage text file and use LoadSubImage().
Your GPU (and therefore frame rate) will thank you for using either of my suggestions.
It is better to remain silent and thought a fool than to speak out and remove all doubt - Anon

Login to post a reply

Server time is: 2024-04-23 07:10:52
Your offset time is: 2024-04-23 07:10:52