Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Miniwindows
➜ Quick question about the Repaint function
|
Quick question about the Repaint function
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Wuggly
USA (112 posts) Bio
|
| Date
| Sat 09 Apr 2016 08:37 PM (UTC) Amended on Sat 09 Apr 2016 08:44 PM (UTC) by Wuggly
|
| Message
| Hello again,
Recently, I've been working on building a sidebar that you can close and pull back out with it animated when it closes/opens.
My question is, is it possible to specify which windows to Repaint instead of it repainting all the windows?
Here's an animated gif of what I've got so far.
http://i.imgur.com/WEtrMZa.gifv
It's not smooth as I have it moving in counts of fives to make it move faster.
If I could specify which windows to repaint, I could possibly change it to moving one X position at a time instead of five, and I believe it would move faster since it wouldn't be repainting all the windows at once, which would give it a smoother look.
Also it moves a bit smoother than it does in the animated gif, as the screen recorder was lagging me a bit. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Sat 09 Apr 2016 08:57 PM (UTC) |
| Message
| No, you can't. Miniwindows are set up in an off-screen buffer, and Repaint causes that to be copied to the screen. There is no provision for a partial copy.
You could add some timing to your code (see utils.timer). It may be that redrawing your miniwindow with the image shifted is actually the part taking most of the time.
You could set up some off-screen miniwindows with the scrolling pre-prepared, and quickly copy them into position.
However I usually have found that when you try to animate one thing (eg. a box) on its own, and you are staring at it, it looks less smooth than most animations. For example in a game you might have your eyes on the enemy firing at you, and don't notice that in the background things aren't moving perfectly smoothly.
Modern operating systems manage quite smooth scrolling of things by leveraging off the capabilities of 3D graphics cards (which can be told to move a bitmap by merely re-specifying its coordinates directly to the card. You can't do that in MUSHclient.
It's really supposed to be a text game client. Things like the mapper look pretty smooth because it updates in a chunky way by its nature. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
12,394 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top