Blitting shows in Emulator but not on Smartphone HELP

Started by dubbox, October 07, 2014, 06:22:57 PM

Previous topic - Next topic

dubbox

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
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


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

EgonOlsen

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?

dubbox

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 ?

EgonOlsen

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.

dubbox

Shall i send you the .apk or the project folder and how shall i give it to you ?

dubbox

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 ??

EgonOlsen

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.

dubbox

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 ?

EgonOlsen

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.

dubbox

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