0

I have made a countdown timer using C# on basic form window and i want it to appear on game screen i tried to set form properties but it wont work on game screen. how would it be done? Any Idea?

Inv Xaasha
  • 83
  • 1
  • 2
  • 9

2 Answers2

0

If you are looking to draw a timer into an existing DirectX or OpenGL backed game then I suggest you take a look at the following question which offers information about hooking and the ability to intercept calls along with working with the applications draw calls. However I believe this is above the level of complexity you would wish to encounter for adding a timer.

LINK : OpenGL/DirectX Hook - Similar to FRAPS

Community
  • 1
  • 1
S_BatMan
  • 505
  • 6
  • 13
0

As you don't indicate if you are using OpenGL, XNA or what I will give you a generic response.

If it is your game

Your splash screen should be part of the game loop. This means that will have an update() and a draw().

  • In the update method you have to calculate the remaining time and store it in a variable or property of an object.

  • In the draw method you should paint the remaining time.

My recommendation is that you create a TimeCounter class because seems you are also going to reuse it during game.

If it is not your game

  • Most games will switch to full-screen direct-render mode. It is not impossible but pretty hard.

  • If the game is web, then you can wrap it in IFrame or similar and put the counter

Oscar Foley
  • 6,817
  • 8
  • 57
  • 90