Author Topic: Blitting shows in Emulator but not on Smartphone HELP  (Read 2742 times)

Offline dubbox

  • byte
  • *
  • Posts: 24
    • View Profile
Blitting shows in Emulator but not on Smartphone HELP
« on: October 07, 2014, 06:22:57 pm »
Hello since im new to Texturing i am gonna need to ask you another question and hope you can help again

i am quiet confused because i worked out how to blit tetures to use them as gui elements and so i implemented 2 buttons with 4 textures 2 per each (one pressed one normal)

everything works fine the emulator shows all the buttons and the clicking effects working nicely

but now i loaded the .apk to my smartphone and i cant see any of the buttons i added i thought blitting is for android
i checked twice if i had exported the rigth way etc i dont know what i am doing false everything runs on smartphone without errors but no buttons are visible


here i add the textures to the texturemanager in the onsurfacecreated method
Code: [Select]
bhn = new Texture(getAssets().open("Buttons/bhn.png"));
bhp = new Texture(getAssets().open("Buttons/bhp.png"));

bfn = new Texture(getAssets().open("Buttons/bfn.png"));
bfp = new Texture(getAssets().open("Buttons/bfp.png"));
} catch (IOException e) {
e.printStackTrace();
}
if(!tm.containsTexture("bhn"))
tm.addTexture("bhn", bhn);
if(!tm.containsTexture("bhp"))
tm.addTexture("bhp", bhp);

if(!tm.containsTexture("bfn"))
tm.addTexture("bfn", bfn);
if(!tm.containsTexture("bfp"))
tm.addTexture("bfp", bfp);
}

and here i blit them in the ondrawframe method

Code: [Select]
fb.clear(back);
world.renderScene(fb);
world.draw(fb);

//Blitting
fb.blit(tm.getTexture(bh), 0, 0, bhnX, bhnY
,128 ,128 , buttonWidth, buttonHeight, 100, false, null);
fb.blit(tm.getTexture(bf), 0, 0, bfnX, bfnY
,128 ,128 , buttonWidth, buttonHeight, 100, false, null);
fb.display();

i am kind of helpless rigth here because i am new to jpct ae and all that stuff and there is no error output i could watch
i hope you guys can think of a cause for my problem or maybe you had the same so please share your opinions with me

thank you all for your help
« Last Edit: October 07, 2014, 06:26:01 pm by dubbox »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Blitting shows in Emulator but not on Smartphone HELP
« Reply #1 on: October 07, 2014, 07:10:26 pm »
There is/was an issue of that kind on some devices, but i actually considered it fixed. Which device are you using and, more important, what's the GPU that this device uses?

Offline dubbox

  • byte
  • *
  • Posts: 24
    • View Profile
Re: Blitting shows in Emulator but not on Smartphone HELP
« Reply #2 on: October 07, 2014, 07:16:03 pm »
I am using a Samsung Galaxy S lll and a ARM Mali-400-MP-GPU i think maybe it is an export issue because i think the gpu should not be the problem or ?

and is there another way i coukd implement these buttons so it will work properly ?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Blitting shows in Emulator but not on Smartphone HELP
« Reply #3 on: October 07, 2014, 07:25:51 pm »
It should actually work fine on an S3. Can you provide me with a test case, so that i can try it for myself on a S3.

Offline dubbox

  • byte
  • *
  • Posts: 24
    • View Profile
Re: Blitting shows in Emulator but not on Smartphone HELP
« Reply #4 on: October 07, 2014, 07:44:33 pm »
Shall i send you the .apk or the project folder and how shall i give it to you ?

Offline dubbox

  • byte
  • *
  • Posts: 24
    • View Profile
Re: Blitting shows in Emulator but not on Smartphone HELP
« Reply #5 on: October 07, 2014, 07:47:17 pm »
Could it possibly be that its cause i dobt use the display.size method cause i wanted it to work for older api levels too so i used display.getwidth and height to get the screen size and so zhe buttons are posted somewhere outside the screen ??
« Last Edit: October 07, 2014, 07:50:24 pm by dubbox »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Blitting shows in Emulator but not on Smartphone HELP
« Reply #6 on: October 07, 2014, 08:19:03 pm »
I'm not sure. If you yre blitting them according to the screen size, i don't see why they should be outside. Maybe you want to compare your values with the ones that FrameBuffer.getWidth()/getHeight() return. Can you actually press these invisible buttons? If not, it's some placement issue on your side. If yes, either your button coordinates don't really math the touch coordinates or the rendering is wrong. In the latter case, i prefer the project (or some project that shows the problem) in a zip.

Offline dubbox

  • byte
  • *
  • Posts: 24
    • View Profile
Re: Blitting shows in Emulator but not on Smartphone HELP
« Reply #7 on: October 07, 2014, 08:59:38 pm »
Ill test it with an logoutput when pressing the buttons location ill get the location the same way like the of the buttons if that wont help ill send you my project Folder but can i do that oer private medsage or do i need your mail cause of size restrictions ?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Blitting shows in Emulator but not on Smartphone HELP
« Reply #8 on: October 07, 2014, 09:08:38 pm »
Either mail it (if it isn't too large) or upload it to something like mediafire or dropbox and send me the link in a PM.

Offline dubbox

  • byte
  • *
  • Posts: 24
    • View Profile
Re: Blitting shows in Emulator but not on Smartphone HELP
« Reply #9 on: October 07, 2014, 09:14:04 pm »
i am uploading it to dropbox rigth now

so i tested the button clicks are applied you can see that cause i move the cam when clicked on a button rigth so if you click where the buttons should be you will cause the camera to move and it happens so the blitting seems to bug :
i am glad you help would be lost without you