How load "images" in the window?

Started by MegasXLS, August 27, 2010, 02:40:59 PM

Previous topic - Next topic

MegasXLS

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

EgonOlsen


MegasXLS

How do I load images in my FrameBuffer to show by example the image of my character in my application?

MegasXLS

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.

EgonOlsen

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

MegasXLS

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

EgonOlsen

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

MegasXLS

Is just error in my copy. But the two have the same name.

MegasXLS

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

paulscode

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