forums

TNT Basic Forums > Feedback
other easy request...
< Last Thread     Next Thread >
Author
Thread        Post A Reply

02-22-2003 19:27

Posted by:
matteo

Location:
Venice, ITALY!

Click Here to Email matteo   Find more posts by matteo

I would like a function that tells if the mouse is pointing on a sprite.
(I replace it putting a small invisible sprite with the coordinates mousex,mousey, and checking if sprite col (the invisible sprite, the sprite to point on; anyway it' s not so great...).

I also liked to know if it is possible to draw something on top of a scrolling background (it does not seem possible, it looks that if you open a viewport, there is no way to draw on top of it).

02-24-2003 16:24

Posted by:
matteo

Location:
Venice, ITALY!

Click Here to Email matteo   Find more posts by matteo

Oh, I forgot a few other stuff:

1) I' d like a function that tells me the actual FPS.

2) I' d like that once I check "show FPS" in the TNT menu, I could ALWAYS see the fps, not having to check the option every time i quit TNT. (very frustrating)

3) On os 9 at least, very often I see just a black rectangle where the FPS number should be, even if "show FPS" is on.

03-23-2003 09:41

Posted by:
matteo

Location:
Venice, ITALY!

Click Here to Email matteo   Find more posts by matteo

Somebody say something on these? I think they are pretty usefull...

03-23-2003 13:35

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

Yeah, something like getFramerate. But it's possible to fake using the timer:

framerate = 1/((timer-TimerOfLastFrame)/1000)

03-30-2003 21:10

Posted by:
Mark Tully

Location:
TNT HQ, England

Click Here to Email Mark Tully   Find more posts by Mark Tully

Use 'Timer' function

I was about to suggest what Matthew said. The TNT Basic FPS display is worked out using the timer function too. It just uses an array of 5 elements or so to record the average render time for the last 5 frames in milliseconds. Then it just averages them out.

Mark

03-30-2003 23:10

Posted by:
Machi

Click Here to Email Machi   Find more posts by Machi

Yeah - I've done this stuff with the timer as well. There are only two problems, from my point of view.

1) You must ensure that your counter routine is called for every draw frame - which just tends to clutter up the code a bit unless you use a simple procedure to execute every draw frame.

2) There's a sort of Heisenberg Uncertainty Principle in play, because the extra work that is done in calculating (very minimal impact) and displaying (greater impact) the framerate actually slows the framerate a little. Because I was only doing this in order to more precisely link the calculation of framerate to specific actions within my program, this latter issue made it a little self defeating.

03-30-2003 23:12

Posted by:
Machi

Click Here to Email Machi   Find more posts by Machi

... oh, sorry, I shuold add to the second point that I was graphing the framerate over time, so that also had a greater impact on performance.
(Made very interesting viewing however)

03-31-2003 22:51

Posted by:
matteo

Location:
Venice, ITALY!

Click Here to Email matteo   Find more posts by matteo

Ok, I guess that request was pretty stupid...

Instead, I' d like a function such as "see framerates" that would show me the framerates also in a built version. (so I can ask other people to tell me the framerates they get, or so they know the framerates) That would avoid me a lot of boring code.

PS:Machi, have you that code?

04-01-2003 18:53

Posted by:
Mark Tully

Location:
TNT HQ, England

Click Here to Email Mark Tully   Find more posts by Mark Tully

OK, we'll add some show/hide fps commands and make the fps option be remembered from run to run.

If you've not disabled break in the built game, your user can hit esc and choose show fps from the menu.

As for the timing impact, there will always be an impact on performance but it won't be enough to worry about. There will be more of an impact if it's worked out in your code than ours though so we'll do it in ours if you need it.

Cheers,

Mark

04-01-2003 19:56

Posted by:
Mark Tully

Location:
TNT HQ, England

Click Here to Email Mark Tully   Find more posts by Mark Tully

Sprite Col

As for the sprite colliding with the mouse cursor - have you tried using 'sprite col rect' with a rect of 1x1 where the mouse is?

Cheers,

Mark

04-01-2003 21:41

Posted by:
Machi

Click Here to Email Machi   Find more posts by Machi

Hi Matteo - It's nothing special, but I'll email you the code snippet later today

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.