Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / PNG Crosshair Image Not Displaying In 3D FPS Game.

Author
Message
Flux
14
Years of Service
User Offline
Joined: 19th Feb 2010
Location:
Posted: 19th Feb 2010 22:09
Hey folks,

I'm having trouble with a .png image. I have checked and it is successfully loading however it isn't displaying. Here is my code snippet...



I'm trying to load the crosshair png used in Dark Dungeon with similar code. I have put the file in the Media folder and I have checked the file path.

Any help would be much appreciated. Thanks.
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 19th Feb 2010 23:56
Are you re-pasting it every time? Or are you just pasting it once? I'm pretty sure an image is only displayed once, until dbPasteImage is called again.

Success = Determination * Mood;
Flux
14
Years of Service
User Offline
Joined: 19th Feb 2010
Location:
Posted: 20th Feb 2010 00:10
That has solved the issue. Thank you very much. All I had to do knowing that was move the second line into the main loop.

Where is it best to find information such as this? I have found the documentation and information contained in the headers to be somewhat limited. Maybe I'm looking in the wrong place.
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 20th Feb 2010 07:32
it's sad that you cant find such info without trying / asking, GDK documentation is outdated, and it doesnt give any tips, just functions description, and some of them are not described well..

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 21st Feb 2010 12:37
@Flux

There are two types of object in DarkGDK. The first type includes things such as 3d objects and sprites. These are drawn automatically by DarkGDK every time dbSync is called. Also, when you create any of these objects, it enables the 3d backdrop. The 3d backdrop clears the screen every time you call dbSync.

The second type of object includes things such as text, boxes, lines, pasted images, etc. These things are drawn manually using drawing commands, and so every time the screen is cleared, they must be drawn again. Obviously, if the backdrop is enabled you must draw them before every dbSync because it clears the screen.

Another difference is when you drag the DarkGDK window. When this happens, your code is no longer running, and so only things in the first group will be drawn (because they are drawn by DarkGDK).

Flux
14
Years of Service
User Offline
Joined: 19th Feb 2010
Location:
Posted: 21st Feb 2010 15:12
Thanks, that really clears a lot up. Now I should be able to use circles or lines for my crosshair instead. I assumed this would be the case once I heard about how pasteimage needs to called each time screen is updated.

Login to post a reply

Server time is: 2024-10-05 16:30:48
Your offset time is: 2024-10-05 16:30:48