寄信人: <hoejohn.bbs@bbs.whnet.edu.cn>
标 题: [转寄] 如何制作动画效果(转载)
发信站: 复旦大学日月光华站 BBS 信使
日 期: Tue Jul 13 15:03:41 1999
要制作动画效果,除了知道一些颜色的配置外,还要知道以下的光标控制符:
光标控制 (注意:这些都是大小写敏感的,*是按两下Esc得到的)
*[nA 光标上移n行
*[nB 光标下移n行
*[nC 光标右移n行
*[nD 光标左移n行
*[y;xH设置光标位置
*[2J 清屏
*[K 清除从光标到行尾的内容
*[s 保存光标位置
*[u 恢复光标位置
以及:光标控制(2)
*[y;xf 设置光标位置(现已很少使用)
*[nL 在光标行前插入n行 (NANSI)
*[nM 删除包括光标行在内的n行 (NANSI)
*[n@ 在光标处插入n个空白字符 (NANSI)
*[nP 删除包括光标位置在内的n个字符 (NANSI)
所谓动画效果,就是在显示后一个字符时,时间比前一个字符要迟缓一段时间,
即是用控制符制作一段延时,我们的做法是,因为netterm一般只有24行,就将当前的
坐标位置先保存下来,然后将光标跳到第25行或第50行(我们看不见),再做删除几百
个空行的动作或删除几百空白字符,达到延时的效果,然后恢复光标的位置。
如上面的1到5之间的做法是:
1*[s*[25;0f*[500M*[u5
-^=^^=====^^====^^=^-
| | | | | |___________ 显示 5
| | | | |_________ 取出保存的坐标位置
| | | |_____ 在第25行那做删除500行的动作,改为*[500@也可以
| | |____ 将光标跳到第25行第0个位置,改成*[50;0f也一样的效果
| |______将当前的坐标位置保存下来
|___ 首先显示 1
--
wWWWw _(_)_ ◣
(___) 携同逝去了的梦 欣赏雨中恋人们相护送 (_)@(_)
Y 那雨后的冷意 昨日也一样浓 (_)\
\ |/ 寂寥茫然的风 情怀仍未冻 \\|/
\\|/// 让昨日柔柔思忆 心中舞动 \\\|//
E-mail:GeminiII@163.net
※ 修改:·unknown 於 Jul 16 15:49:11 修改本文·[FROM: 10.64.5.133]
※ 来源:·日月光华站 bbs.fudan.edu.cn·[FROM: 10.64.5.40]
Sender: <hoejohn.bbs@bbs.whnet.edu.cn>
Title: [Repost] How to create animation effects Reprint
Sending station: Fudan University Sun and Moon Guanghua Station BBS Messenger
Date: Tue Jul 13 15:03:41 1999
To create animation effects, in addition to knowing some color configurations, you also need to know the following cursor control symbols.
Cursor Controls Note these are case sensitive *are obtained by pressing Esc twice
*[nA Move the cursor up n lines
*[nB Move the cursor down n lines
*[nC Move cursor n lines to the right
*[nD Move cursor left n lines
*[y;xH sets the cursor position
*[2J Clear screen
*[K clears the contents from the cursor to the end of the line
*[s save cursor position
*[u restore cursor position
and cursor control 2
*[y;xf sets the cursor position and is now rarely used
*[nL Insert n lines before the cursor line NANSI
*[nM Delete n lines including the cursor line NANSI
*[n@ Insert n blank characters at the cursor NANSI
*[nP delete n characters including cursor position NANSI
The so-called animation effect means that when the next character is displayed, the time is slower than the previous character.
That is to use control characters to create a delay. Our approach is because netterm generally only has 24 lines.
Save the coordinate position first, then jump the cursor to line 25 or 50, which we cannot see, and then delete a few hundred
The action of a blank line or deleting hundreds of blank characters achieves a delay effect and then restores the cursor position.
For example, the method between 1 and 5 above is
1*[s*[25;0f*[500M*[u5
^ ^^ ^^ ^^ ^
Showing 5
Get the saved coordinate position
In line 25, you can delete 500 lines by changing it to *[500@.
Jump to the 0th position of line 25 and change the cursor to *[50;0f, which will have the same effect.
Save the current coordinate position
Show first 1
wWWWw
Carry the lost dream and enjoy the escort of lovers in the rain @
Y The chill after the rain was just as strong yesterday
The lonely and confused wind, the feelings are still not frozen
Let the tender memories of yesterday dance in your heart
E mail GeminiII@163.net
Modification: unknown modified this article on Jul 16 15:49:11 [FROM: 10.64.5.133]
Source: Sun and Moon Guanghua Station bbs.fudan.edu.cn [FROM: 10.64.5.40]