Sign in to follow this  

[.net] Smooth Scrolling

This topic is 4285 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

1) First of all I use Microsoft.DirectX.Direct3D.Font.DrawText(....) for creating 2d text and change x-y parametrers for scrolling 2) I can calculate framerate as below : ++frames; int ticks = Environment.TickCount; int elapsed = ticks - lastTickCount; if (elapsed > 1000) { int framerate = frames; frames = 0; this.FPS = framerate ; lastTickCount = ticks; } But how can i use them together and get a SMOOTH scroll ? Or am i on the wrong way ???

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
posting the same question on *all* forums is definitely not a great idea.

Share this post


Link to post
Share on other sites
Try the [ source lang="cpp"] // Your code ... [/source] tags (without the space after '[') or [ code] ... [/code] tags. They make your code much more readable,thus more people will bother to read it.


++frames;
int ticks = Environment.TickCount;
int elapsed = ticks - lastTickCount;
if (elapsed > 1000)
{
int framerate = frames;
frames = 0;
this.FPS = framerate;
lastTickCount = ticks;
}







Click on the EDIT button Edit Button next to posts to see how I did it (and to change your own post).

Edit: Whoops [headshake]

Share this post


Link to post
Share on other sites

This topic is 4285 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this