Author Topic: About overlay class  (Read 818 times)

Offline zhangbo8808

  • byte
  • *
  • Posts: 11
    • View Profile
About overlay class
« on: July 11, 2012, 12:45:36 pm »
I want to show some pictures above my screen(for example,arrow/up/down/left),so I use overlay.
I wrote like this:

Texture arrowdown=new Texture(BitmapHelper.rescale(LoaderMana.LoadBitMap(R.drawable.arrowdown),128,128));
TextureManager.getInstance().addTexture("arrowdown",  arrowdown);
Overlay down = new Overlay(world, 128, 128, 256, 0, "arrowdown");

But the arrow did't show,Is there any problems?or is there any other ways?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11744
    • View Profile
    • http://www.jpct.net
Re: About overlay class
« Reply #1 on: July 11, 2012, 12:54:27 pm »
You can use FrameBuffer.blit(...) instead. However, Overlay actually works fine as far as i know. Your coordinates look a bit strange though:

128, 128, 256, 0
   
Your lower right corner y value is above the upper left...that doesn't make much sense.

Offline zhangbo8808

  • byte
  • *
  • Posts: 11
    • View Profile
Re: About overlay class
« Reply #2 on: July 12, 2012, 09:28:55 am »
thank you, I got it. very low gradewrong. I thought the L+B is the origion(actually the L+T). so my overlay is out of my screen