hubert
Junior Member
Posts: 10
|
Post by hubert on Oct 3, 2015 23:51:21 GMT -8
Hello, Can someone please help me? I read everything about Assets but I don't understand it. How does it work?
Lets say I have 3 pictures(.png) and I want them to be converted to a single gd2 File. Then I would open Terminal in Mac, cd to the folder I am working in, and type in:
python gd2assets -f outputfilename.gd2,pic1.png,pic2.png.pic3.png am I right? It should now create a file called "outputfilename.gd2" which is a asset file and that I can put on my SD card and use it in Arduino?
Can someone please help me? How does it exactly work?
Thank you a lot
|
|
|
Post by jamesbowman on Oct 4, 2015 7:14:23 GMT -8
If you run it like this: gd2asset -f myassets.gd2 -o myassets.h pic1.png pic2.png pic3.png then it creates two files: - myassets.gd2 - copy this onto your microSD
- myassets.h - include this from your program
Copy myassets.gd2 to the SDcard, and in your sketch do: #include "myassets.h" then after GD.begin(), do: LOAD_ASSETS(); and you can use the assets pic1, pic2, pic3, for example: GD.Begin(BITMAPS); GD.Vertex2ii(10, 100, 0); // pic1 GD.Vertex2ii(10, 200, 1); // pic2 GD.Vertex2ii(10, 300, 2); // pic3
|
|
hubert
Junior Member
Posts: 10
|
Post by hubert on Oct 4, 2015 21:32:02 GMT -8
Hello, when I do this, it gives me that error: "python: can't open file 'gd2assets': [Errno 2] No such file or directory" Why does this happen? Thank you
|
|
|
Post by jamesbowman on Oct 5, 2015 7:07:23 GMT -8
If you are on a Mac, and you have already done:
sudo easy_install -U gameduino2
then you can run the converter like this:
gd2asset -f myassets.gd2 -o myassets.h pic1.png pic2.png pic3.png Sorry for my mistake earlier. I have updated the thread.
|
|
hubert
Junior Member
Posts: 10
|
Post by hubert on Oct 5, 2015 7:37:16 GMT -8
Hello,
now I got that Error at the end:
ImportError: No module named Image
Why?
|
|
|
Post by jamesbowman on Oct 5, 2015 11:10:37 GMT -8
|
|
hubert
Junior Member
Posts: 10
|
Post by hubert on Oct 5, 2015 20:12:48 GMT -8
Oh man you are the best!!! It works!!! so sweet :-) Thank you very very very much!!!
|
|