pirni
New Member
Posts: 5
|
Post by pirni on Feb 20, 2014 8:33:01 GMT -8
Hy!
I convert some images to one Asset but i have a problem on screen.
Some images are ok and some images are only symbols or stripes.
had some one else the same problem?
pirni
|
|
|
Post by jamesbowman on Feb 20, 2014 15:30:17 GMT -8
With some more details, I think we can probably give more help.
Perhaps supply the problem images, and the asset-converter command-line?
|
|
pirni
New Member
Posts: 5
|
Post by pirni on Feb 21, 2014 6:49:08 GMT -8
python gd2asset -f aqua.gd2 about.png accept.png accounts.png alarm.png appdrawer.png back.png brightnessauto.png brightnesshigh.png brightnesslow.png brightnessmedium.png calender.png cancel.png chat.png clock.png cloud.png datausage.png edit.png flashon.png forward.png help.png keyboard.png networkcell.png nexus.png reply.png sdstorage.png setting.png settings.png storage.png time.png undo.png wifi.png
then i copy the gd2 file on the sd card
setup:
GD.begin(); LOAD_ASSETS(); GD.swap();
for example:
void scrMenu() {
GD.ClearColorRGB(GRAY); GD.Clear();
GD.Begin(LINES); GD.Vertex2ii(x0, y1 - 70); GD.Vertex2ii(x1, y1 - 70);
GD.Tag(TAG_MENU_BACK); GD.Begin(BITMAPS);
GD.BitmapHandle(UNDO_HANDLE); GD.Vertex2ii((x1 / 2) - 32, y1 - 64, UNDO_HANDLE); // X = 72 Y = 24
GD.BitmapHandle(WIFI_HANDLE); GD.Vertex2ii(72, 24, WIFI_HANDLE); GD.BitmapHandle(TIME_HANDLE); GD.Vertex2ii(72 * 2 + 64, 24, TIME_HANDLE); GD.Tag(TAG_MENU_TIME); // ##################### ACHTUNG TAG CaLENDER AUF TIME ZWECKS TEST #################### GD.BitmapHandle(CALENDER_HANDLE); GD.Vertex2ii(72 * 3 + 128, 24, CALENDER_HANDLE); GD.BitmapHandle(CLOUD_HANDLE); GD.Vertex2ii(72 , 112, CLOUD_HANDLE); GD.BitmapHandle(FLASHON_HANDLE); GD.Vertex2ii(72 * 2 + 64, 112, FLASHON_HANDLE); GD.BitmapHandle(HELP_HANDLE); GD.Vertex2ii(72 * 3 + 128, 112, HELP_HANDLE);
GD.swap(); }
some pics i can see some not
all pics are png 64x64 32 bit
|
|
|
Post by jamesbowman on Feb 21, 2014 15:38:19 GMT -8
OK, thanks for posting this. The GD2 hardware supports only 15 bitmap handles. So this situation is overflowing the bitmap handles, and only the first 15 are being displayed. I have just updated gd2asset to version 0.1.2: - Reports error for more than 15 bitmap handles
- Reports error for more than 256KB used
- Supports multiple images per handle
To update do
easy_install -U gameduino2 With this version you can put multiple images in the same handle by separating them with a comma. So:
python gd2asset -f aqua.gd2,about.png,accept.png,accounts.png,alarm.png,appdrawer.png,back.png,brightnessauto.png,brightnesshigh.png,brightnesslow.png,brightnessmedium.png,calender.png,cancel.png,chat.png,clock.png,cloud.png,datausage.png,edit.png,flashon.png,forward.png,help.png,keyboard.png,networkcell.png,nexus.png,reply.png,sdstorage.png,setting.png,settings.png,storage.png,time.png,undo.png,wifi.png
puts everything in one bitmap handle (AQUA_HANDLE), and to draw the fourth image, "alarm", do:
GD.Vertex2ii(x, y, AQUA_HANDLE, 4);
|
|
pirni
New Member
Posts: 5
|
Post by pirni on Feb 22, 2014 8:47:47 GMT -8
Hy!
i startet the command as you said but it stops with an error
i changed the syntax from
python gd2asset -f aqua.gd2,about.png,...
to
python gd2asset -f aqua.gd2 about.png,...
and it works with
GD.Vertex2ii(x, y, ABOUT_HANDLE, 4);
i created defines for all the images because i hate it to search image count it and load it could you create a function to add defines in the header file for the images?
i mean:
GD.Vertex2ii(x, y, ABOUT_HANDLE, 4); to GD.Vertex2ii(x, y, ABOUT_HANDLE, #DEFINE_IMAGE_NUMMER);
sry for my bad english i´m from Austria :)
|
|
tango
New Member
Posts: 6
|
Post by tango on Aug 14, 2016 7:47:48 GMT -8
Hi, im trying to use the assets converter, but i dont understant it. I install phyton 2.7, the easy-setup, and the image library that indicates in the page, then i try to use using the comands like example, but, where i put the image and where is the asset file?? can anyone help me? a small tutorial could be perfect...
|
|
|
Post by jamesbowman on Sept 10, 2016 17:53:03 GMT -8
|
|