[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Miniwindows
. . -> [Subject]  Quick question about the Repaint function
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Quick question about the Repaint function

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Wuggly   USA  (112 posts)  [Biography] 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.
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] 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
[Go to top] 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.


1,795 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]