发信人: seaboy (要从太阳上取金子的化学家), 信区: ANSI
标 题: ASCII入门教程(六)————动画延时②
发信站: 日月光华 (2003年04月02日19:36:17 星期三), 站内信件
这篇将介绍一种动态效果,但它不是用延时函数*[nM来实现的,而是用我们
前面所讲过的闪烁函数*[5m来实现的,这种动态效果只要是支持颜色和闪烁
的telnet软件都能观看。其实制作起来也很简单,其原理只是利用前景色与
背景色的交 嫔了咐 达到动态效果的,� 面我们举例来说明
例如下面这个效果
██
暗紫色和暗青色两个颜色的色块左右互换,这个图案的代码是
*[0;5;35;46m█*[36;45m█*[m
为什么会产生互换的效果呢?,仔细看一下代码,首先这个图案是由两个█
组成的,我们在上色的时候巧妙的为他们上了颜色,将其中的一个上成暗青
色,但是背景色却用暗紫色,将另一个上成暗紫色,但是背景却用暗青色,
由于█这个图案比较特殊,它所占的位置正好和一格背景色占的位置一样大
所以当我们将█ 闪烁函数使其闪烁起来之后,那个位置上的颜色� 会变成
前景色和背景色交替出现,这样那个位置的颜色就会一会暗紫色,一会暗青
色,这两个图案的前景色和背景色正好相反,所以就会产生暗紫色和暗青色
不断交换位置的效果。
利用这个原理我们可以用这些方块图形做一些动态变化的图案,例如下面这个
█████
█ █ █
█ █ █
█ █ █
█████
字母I变成了U,U又变成了I,这样交替变化,就是利用了上面我们所说的那种
方法做出来得动态效果,巧妙的运用█图案和为他们配上合适的背景色与前景
色,相信你也能充分发挥出自己的想象力,制作出漂亮的动态图形。
--
◢ ╭╮ ◆ │ ◣
ヽ ╰╮ │ ◤
◢ ┃╭┓╭╮┣╮╭┓┳╭ ◥
╯ ╰╯┣╯╰┻╰╯╰╯╰┫ ╰ ▼
◣ ◤ ╰╯ │ ◣
╰╯
※ 来源:·日月光华 bbs.fudan.edu.cn·[FROM: 10.100.107.130]
Sender: seaboy Chemist who wants to get gold from the sun, message area: ANSI
Title: ASCII introductory tutorial 6 Animation delay②
Sending site: Sun and Moon Guanghua Wednesday, April 2, 2003 19:36:17, site mail
This article will introduce a dynamic effect, but it is not implemented using the delay function *[nM, but using our
The flicker function*[5m mentioned earlier is used to achieve this dynamic effect as long as it supports color and flicker
All telnet software can watch it. In fact, it is very simple to make. The principle is just to use the foreground color and
Let’s take an example to illustrate how the background color can be combined to achieve dynamic effects.
For example, the following effect
The color blocks of dark purple and dark cyan are interchanged left and right. The code of this pattern is
*[0;5;35;46m *[36;45m *[m
Why does the interchange effect occur? Take a closer look at the code. First of all, this pattern is composed of two
When we were painting, we cleverly colored them, turning one of them into dark blue.
color, but the background color is dark purple. The other color is dark purple, but the background color is dark cyan.
Because this pattern is quite special, it occupies exactly the same space as a background color.
So when we use the flicker function to make it flicker, the color at that position will become
The foreground color and background color appear alternately, so that the color at that location will be dark purple for a while and dark cyan for a while.
Color: The foreground color and background color of these two patterns are exactly opposite, so dark purple and dark cyan will be produced.
The effect of constantly swapping positions
Using this principle, we can use these square graphics to make some dynamically changing patterns, such as the following one
The letter I turned into U and U turned into I again. This alternating change is taking advantage of what we mentioned above.
The method to create dynamic effects is to skillfully use patterns and match them with appropriate background colors and foregrounds.
Color I believe you can also give full play to your imagination and create beautiful dynamic graphics.
ヽ
Source: Sun and Moon Guanghua bbs.fudan.edu.cn [FROM: 10.100.107.130]