Porting to Mac
Monkey Forums/Monkey Programming/Porting to Mac
| ||
Hi. I'm porting my game to Mac and I got an error when loading an image. It simple doesn't load the image. It's a simple PNG, transparent background, small image. I have plenty of images loaded before, all png, and one isn't being loaded. What can it be? In Windows, the game runs perfectly. The MacOS, I think, is Mountain Lion, I'm not sure, it's a borrowed one... And I'm not that familiar with Mac... Edit: Mac OS X, version 10.7.5, Intel Core 2 Duo, 2GB RAM. Thanks Cristiano |
| ||
Double check your filename for case sensitivity. Then check for file permissions (right click -> get info). |
| ||
Hi, Shinkiro1. No problems with the name or permissions... |
| ||
Hello, guys!! Anyone??? Regards! Cristiano |
| ||
Your image is encoded with an encoding not supported by the OS or system running it on the OS. For images like these, I take them into Windows Picture (Image?) Gallery and rotate the image and close it. Open the image in Windows Picture Gallery again and rotate it back, then close. That will set its encoding to a more universally accepted encoding. I had this issue with every OS in one way or another because of some of the PNG encodings I was using. |
| ||
I did what you said, but the error remains, Goodlookinguy... :( |
| ||
And, Goodlookinguy, I've created others images based on the one with problem, and nothing... If you want I can send you the image to you see... I believe the problem will happens to others... Regards Cristiano |
| ||
I'm afraid I'm on vacation away from my Mac so I can't test from here. Another recommendation would be to simply copy the image contents into a new image you create in photoshop, graphics gale, or whatever you use, and see if it works. I've also had that work for me before. Other than that, I'm not entirely sure. |
| ||
Ok. Yes, as I told, I did that and didn't work.. Don't know what else to do... |
| ||
Post the image if you wish. I can take a look at it and see if there's anything strange that would cause it to fail. Other than that, bringing this up to Mark in the bugs section is the next step. |
| ||
Hi, Goodlookinguy.... Here is a link to download the image. pancada.png Thanks. |
| ||
it works on my macbook with the latest operating system. I tried it it like this: Import mojo2 Function Main() New Game() End Function Class Game Extends App Field image:Image Field canvas:Canvas Method OnCreate() canvas = New Canvas image = Image.Load("pancake.png") SetUpdateRate 30 End Method Method OnRender() canvas.Clear(0,0,0,1) canvas.DrawImage(image,100,100) canvas.Flush() End Method End class also works with mojo 1. I put the image in a folder with the name pancake.data and named the code file pancake.monkey. my question is, Are you doing a canvas flush after you are done with all of the drawings? |
| ||
Hi, Jesse. I'm using mojo1. And the error occurs when I load the image. Monkey simply doens't load it. That's my system: MacOS X 10.7.5 Regards |
| ||
it works the same in mojo1Import mojo Function Main() New Game() End Function Class Game Extends App Field image:Image Method OnCreate() image = LoadImage("pancake.png") SetUpdateRate 30 End Method Method OnRender() Cls DrawImage(image,100,100) End Method End class |
| ||
Putz, now I don't know what to do... Did you edit the image? What's your Monley version? 84f? |
| ||
monkey 85d, used the image as downloaded. only looking at the source code we'll be able to help. |
| ||
check for null on your image download section after download is completeIf image = Null Print "unable to load image" |
| ||
Hey, Jesse. Thank you! You open my mind for one thing. My images are under a subfolder of data folder. To load them on PC you use "\". On Mac it's different. So I changed all the load images and sound and now the game is running.. I'll see if everything is ok now. Than you a lot! Regards Cristiano |
| ||
Monkey should really report, "image not found". Also, regardless of platform, Monkey fixes the data path. So always use "/" for directory changes even if it feels odd. |
| ||
Yes, good idea. Thank you all!! Regards Cristiano |