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.

iOS and MacOS / Graphics with black boxes around them

Author
Message
kackle123
10
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Midwest, USA
Posted: 28th Apr 2012 04:00
Hello all,
I am new to AppGameKit, but not new to graphics nor programming. I slightly modified one of the TGC examples which is attached to this post. It looks good on my PC but the moving graphic has a 1 or 2 pixel black box or border around it when run on an iPad (with iOS v5.1). I am using a current Mac laptop with Xcode 4.3.2 and OSX Lion.

I'm asking whether someone can try my attached code to see if the same issue presents itself. If so, does anyone have any suggestions? I have already tried a number of things like considering "powers of (base) 2" graphics sizing (that is, with dimensions: x=2^a and y=2^b), different graphics file types, and even different color bit depths. Thank you.

Attachments

Login to view attachments
Rich Dersheimer
AGK Developer
13
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 30th Apr 2012 18:23 Edited at: 30th Apr 2012 22:30
Are you using the AppGameKit Viewer? Or the AppGameKit Player?

If you are using the player, is it a build of the latest release?

I'll test your project over lunch today, it looks good on a PC of course. I'll try it on my iPad.

EDIT: I see the black outline on my iPad. Changing the original image to 128x128 makes it go away. But there is still a slight difference in the background and cloud images, even though they are the same color. Making the cloud a .png with the "blue sky" part transparent would make this problem disappear as well.
kackle123
10
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Midwest, USA
Posted: 1st May 2012 05:50 Edited at: 26th May 2012 01:13
Thank you Rich for trying that out for me. I will try to resize to 128 x 128 and see what happens, although I have tried that kind of resizing before and had no luck.

I never noticed that sky blue color difference you mentioned-I'll have to take a closer look. Maybe the different file formats handle color differently and if I change the background to a BMP as well, all would be fixed. I'd hate to deal with cropping the cloud graphics as I have hundreds of them.

To your questions: I was using the AppGameKit Player and only bought the tool ~1 month ago so I assume I'd have the latest Player.

Thank you very much for your help.
kackle123
10
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Midwest, USA
Posted: 2nd May 2012 21:01
Rich,
I think I finally figured out why my previous graphics resizing attempts didn't work. Xcode wouldn't let go of the old graphics. I resized to 128 x 128 as you did, overwrote the old cloud graphic, and, somehow, Xcode continued using the old cloud. It was only after I started a new Xcode project from scratch did the new graphic show up and the black box around it finally disappear.

Regarding the different shades of blue, I did not see any difference on my iPad 2 tester. As the original cloud was 8-bit, palette-based color, did you make any changes to it other than its size?

Thank you again for all of your help!
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 3rd May 2012 23:06
You need to CLEAN project in Xcode when changing assets
kackle123
10
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Midwest, USA
Posted: 4th May 2012 18:17
Thank you bjadams; I thought I did that, but I'll pay closer attention next time.
kackle123
10
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Midwest, USA
Posted: 26th May 2012 01:12
I wanted to add this in case anyone in the future is stuck with the same issue...

Once again I saw more of my graphics with black boxes around them on different iOS devices, even though their x & y dimensions were each set to a power of (base) two. Fiddling with the following graphic attributes seemed to fix the problem(s).

When most of my graphics in my app were at 72 dpi, the few that were at 71 dpi had the black boxes around them.

When most of my graphics in my app were at 32-bit color depth, the few that were at 8-bit had the black boxes around them. Setting these to 24 or 32-bit color resolved the issue.

And as Rich Dersheimer mentioned above, changing my graphics to have a transparent perimeter (in .PNG format) may very well have cleared up the problem too.
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 27th May 2012 10:49
putting a transparent border is not an option for many.
i output all sprite co-ords from photoshop, so having to go through 300+ sprites, add a border, and then adjust the co-ords in the code to offset by -1 is not a good solution.
kackle123
10
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Midwest, USA
Posted: 30th May 2012 20:36
I agree that's a lot of work; but when I said "perimeter", I think Rich meant making sure the graphic is transparent all the way around its sides. Like if you removed the blue part around the cloud graphic that is attached to my post above.

And as I think more about it, the 71 versus 72 dpi attribute difference that I observed doesn't make sense, so perhaps something else is going on too. (Maybe I need to delete the app from the iPad before uploading any new graphics/code to it?)

My issue is resolved, so I'm not going to worry about it unless it pops up again. Thanks to everyone.

Got kid? Hula Hamsters is for ages 3 and up!

Login to post a reply

Server time is: 2022-10-04 15:24:25
Your offset time is: 2022-10-04 15:24:25