Object Image missing

Started by
7 comments, last by Alberth 8 years, 3 months ago

Can someone please provide help in image resource? I'm stuck with the 3 dimension helicopter image that is needed in my game. The tutorial image resource is no longer existing, as a result I'm not able to find the image that I need. Please check the attachment for my code reference.

The helicopter image is also attached. This image is just a screenshot of my tutorial.

Does image need to have its exact size and resolution?

I'm not able to see the helicopter appearing becoz I used another random image that I got from image search. The object image is blank but it does move when I test it for playing.

Advertisement

Please restate your questions with a little more clarity.

Please restate your questions with a little more clarity.

I'm not able to see the hellicopter when I run the game. The hellicopter image I used is different from the one used in the tutorial. How do I get the exact image or similar object image so that I can have it displayed in the game? Thank you for your concern.

There is a lot of information lacking in order to give you the help you want. A link to your tutorial you are following as well as your related code is needed to help you. Also, how are you trying to draw the helicopter?

-All you say is that you cannot see it. What does that mean?

-What graphics API are you using?

-It looks like you are trying to use an atlas texture/sprite sheet, so how are you parsing your images?

The fact that you do not have the exact image from the tutorial is not going to adversely effect your results, only minor details MIGHT change depending on how the image and related buffers are created.

In general, any picture will work, that is, the game really doesn't care what the image shows. (The player does care of course, but that's a different problem.)

It's complicated to understand what you are trying to solve. I deduced the following, if I am wrong, please tell me.

1. You want to display an image in a tutorial game.

2. The game code looks like Java, but it's too small to really read.

3. The image that was part of the tutorial is gone (not available any more).

4. You selected a different image instead.

5. You get a blank rectangle moving about at the screen, without the expected content of the image from 4.

Assuming this is all correct, one possibility is that the file format of the image is wrong. What did you use, .jpg? Jpg support in image display libraries for games is generally terrible (for good reasons, jpg is not very usable for that purpose). The proper solution is to check the documentation of the function that loads the image. It should explain what file formats it understands. (Try it, it's a good exercise, you will need this often.)

As for a random guess, it's likely that the library supports png or bmp files. Convert your image to one of those formats, and try again. (Or find a different image in those formats.)

There is a lot of information lacking in order to give you the help you want. A link to your tutorial you are following as well as your related code is needed to help you. Also, how are you trying to draw the helicopter?

-All you say is that you cannot see it. What does that mean?

-What graphics API are you using?

-It looks like you are trying to use an atlas texture/sprite sheet, so how are you parsing your images?

The fact that you do not have the exact image from the tutorial is not going to adversely effect your results, only minor details MIGHT change depending on how the image and related buffers are created.

There is a lot of information lacking in order to give you the help you want. A link to your tutorial you are following as well as your related code is needed to help you. Also, how are you trying to draw the helicopter?
I'm following the video tutorial below. You can find the code in the video itself. I don't draw helicopter I just copy and paste the image.
-All you say is that you cannot see it. What does that mean?
When I try to play the game, I can see the object moving but for some reason it does not show the Helicopter image , it displays white blank image moving instead. Maybe the image needs its perfect size or something. I downloaded random image from the internet since the source the tutorial provided no longer works.
-What graphics API are you using?
radeon and intel graphics
-It looks like you are trying to use an atlas texture/sprite sheet, so how are you parsing your images?
I have no idea about this since I've just started making my first game.
The fact that you do not have the exact image from the tutorial is not going to adversely effect your results, only minor details MIGHT change depending on how the image and related buffers are created.
Please explain to me about the minor details that I need to change. Thank you

In general, any picture will work, that is, the game really doesn't care what the image shows. (The player does care of course, but that's a different problem.)

It's complicated to understand what you are trying to solve. I deduced the following, if I am wrong, please tell me.

1. You want to display an image in a tutorial game.

2. The game code looks like Java, but it's too small to really read.

3. The image that was part of the tutorial is gone (not available any more).

4. You selected a different image instead.

5. You get a blank rectangle moving about at the screen, without the expected content of the image from 4.

Assuming this is all correct, one possibility is that the file format of the image is wrong. What did you use, .jpg? Jpg support in image display libraries for games is generally terrible (for good reasons, jpg is not very usable for that purpose). The proper solution is to check the documentation of the function that loads the image. It should explain what file formats it understands. (Try it, it's a good exercise, you will need this often.)

As for a random guess, it's likely that the library supports png or bmp files. Convert your image to one of those formats, and try again. (Or find a different image in those formats.)

Yes what you deduced is right.
Please refer the video tutorial that I'm following. You can check the codes in it.
The helicopter image that I used is indeed of jpg format.
I'll try to go through the documentation of the function that loads the image as told by you.
At the same time, i'll also try to convert or find the image of png or bmp formats and see if it works.
Thank you so much for your help.

In general, any picture will work, that is, the game really doesn't care what the image shows. (The player does care of course, but that's a different problem.)

It's complicated to understand what you are trying to solve. I deduced the following, if I am wrong, please tell me.

1. You want to display an image in a tutorial game.

2. The game code looks like Java, but it's too small to really read.

3. The image that was part of the tutorial is gone (not available any more).

4. You selected a different image instead.

5. You get a blank rectangle moving about at the screen, without the expected content of the image from 4.

Assuming this is all correct, one possibility is that the file format of the image is wrong. What did you use, .jpg? Jpg support in image display libraries for games is generally terrible (for good reasons, jpg is not very usable for that purpose). The proper solution is to check the documentation of the function that loads the image. It should explain what file formats it understands. (Try it, it's a good exercise, you will need this often.)

As for a random guess, it's likely that the library supports png or bmp files. Convert your image to one of those formats, and try again. (Or find a different image in those formats.)

Yes what you deduced is right.
Please refer the video tutorial that I'm following. You can check the codes in it.
The helicopter image that I used is indeed of jpg format.
I'll try to go through the documentation of the function that loads the image as told by you.
At the same time, i'll also try to convert or find the image of png or bmp formats and see if it works.
Thank you so much for your help.

Hello Albert sorry for the late reply. I had to take a break from this for some reason. Please get back to me if you get this. Also I have one more question. I'm curious if the sprite image size matters.

Waiting for your reply.

Size in number of bytes doesn't really matter, it is loaded once, and that's it.

Size in horizontal and vertical number of pixels usually does matter. Pixels at the screen and pixels in the image are usually 1:1, 1 pixel in the image becomes 1 pixel at the screen. (Unless you resize the image first, but I guess that doesn't happen in the tutorial.)

If your image is 10 pixels horizontal and 20 pixels vertical, and you plot it at position (50, 70) at the screen, the image will be displayed at the area 50-60 horizontal, and 70-90 vertical at the screen.

If your images is 100 pixels horizontal and 200 pixels vertical, and you plot it at position (50, 70) at the screen, the image will be displayed at the area 50-150 horizontal, and 70-270 vertical at the screen.

This topic is closed to new replies.

Advertisement