Author Topic: How load "images" in the window?  (Read 2644 times)

Offline MegasXLS

  • byte
  • *
  • Posts: 29
    • View Profile
How load "images" in the window?
« on: August 27, 2010, 02:40:59 pm »
Hi guys, i'm begginer in JPCT so....

how i load images in window of my application? The images are load with my application 3D for the user interact with the images for my application response this interact.

thx

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12002
    • View Profile
    • http://www.jpct.net
Re: How load "images" in the window?
« Reply #1 on: August 27, 2010, 08:38:59 pm »
??? Sorry, i don't get this question  ???

Offline MegasXLS

  • byte
  • *
  • Posts: 29
    • View Profile
Re: How load "images" in the window?
« Reply #2 on: August 31, 2010, 02:46:30 pm »
How do I load images in my FrameBuffer to show by example the image of my character in my application?

Offline MegasXLS

  • byte
  • *
  • Posts: 29
    • View Profile
Re: How load "images" in the window?
« Reply #3 on: August 31, 2010, 03:25:18 pm »
I tried to insert a picture in the advanced example of JPCT that exists on the site. But I can not upload any images. I also noticed that in that case I do not have a frame starts before, but the framebuffer. He wanted to know how to load an image in advanced example of the site.

Thank you in advance.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12002
    • View Profile
    • http://www.jpct.net
Re: How load "images" in the window?
« Reply #4 on: August 31, 2010, 08:10:14 pm »
So...i guess you want to display some bitmaps then? In that case, load them as textures (watch the size. They have to have a power of 2 in width and height) and use the blit()-methods in FrameBuffer to display them (or parts of them).

Offline MegasXLS

  • byte
  • *
  • Posts: 29
    • View Profile
Re: How load "images" in the window?
« Reply #5 on: September 14, 2010, 02:42:20 pm »
Hi Guys,
So...

I am not able to load the image in the buffer yet.

buffer.blit (TextureManager.getInstance (). getTexture ("tela"), 0, 0, 0, 0, 512, 512, backward);

I'm calling this statement in gameLoop () after the buffer.update ();

Where "tela" is the image of credits that were in the game robombs egon (Just for testing, congratulations on very nice game)

tm.addTexture ("screen", new Texture ("example / credits.png"));

Thanks in advance

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12002
    • View Profile
    • http://www.jpct.net
Re: How load "images" in the window?
« Reply #6 on: September 14, 2010, 08:45:17 pm »
Why are you refering to the texture as "tela" when it actually has been added as "screen"? Or is this hust a copy and paste error in the you've posted.... ???

Offline MegasXLS

  • byte
  • *
  • Posts: 29
    • View Profile
Re: How load "images" in the window?
« Reply #7 on: September 17, 2010, 02:44:11 pm »
Is just error in my copy. But the two have the same name.

Offline MegasXLS

  • byte
  • *
  • Posts: 29
    • View Profile
Re: How load "images" in the window?
« Reply #8 on: September 17, 2010, 03:37:17 pm »
I managed to load the image Egon (sorry for bad english) I put the statement before the buffer.update () inside my gameloop and everything went right.

Building on the topic,

does anyone know a way to upload a video (in mp4 or other format) into a 3D object into an application using JPCT? My application needs to do a video (any format) run on a TV screen that is loaded in my application. = /

Thank you in advance

Offline paulscode

  • double
  • *****
  • Posts: 863
    • View Profile
    • PaulsCode.Com
Re: How load "images" in the window?
« Reply #9 on: September 17, 2010, 09:58:55 pm »
If you are able to use some 3rd-party library to capture the video frames into instances of java.awt.Image, you can use a texture effect implementation and java.awt.image.PixelGrabber to create a "video texture".  One way is with JMF, as I did in this thread and this one.  JMF doesn't work on the Android, though, so if you need this for a jPCT-AE project, you'll need something else.  I am currently looking into the possibility of grabbing frames from a MediaPlayer into Bitmap instances to either be used in a texture effect or swapping out a Texture (no idea how fast this will would work on a phone, though).