zmud中ansi的颜色丰富了游戏的内容,除了系统返回给客户端的ansi字符显示以外,我们也可以通过客户端的%ansi函数来显示丰富的信息:

#help ansi

#SHOW %ansi(high,red)Hello%ansi(blink,blue,white)Word

比如在状态window显示相关灭妖信息,局部突出怪的名字和地点,以及内力信息。

#stw %ansi(high,red)@guai_name(@guai_nick)%ansi(normal)%cr在%ansi(high,orange)@guai_place%ansi(normal)%cr怪的内力:%ansi(blink,blue,white)@guai_neili%ansi(normal)

其中%cr为换行,可以将显示分多行显示。%ansi(normal)为恢复系统默认颜色.

通过这个函数,我们在客户端也可以输出丰富的ansi文字,甚至可以通过这个来做颜色触发器(因为zmud对屏幕上所有信息都可以触发,不管是不是通过本地#say出来的)。

相同道理,文字显示适用于所有向屏幕输出信息的命令,包括#say/#show/#st/#stw等。

ansi颜色的定义可以参考:ansi.h

Ansi颜色:
[0m 表示ansi颜色结束
[1;33;45m第2项项五第[0m 表示以[1;33;45m定义的颜色文字直到[0m结束[1;33;45m 其中1表示高亮 33高亮前景色 45表示背景色 m为颜色定义后缀具体定义见://   File    :  /include/ansi.h
//  Creator :  Gothic@TMI-2
//
//  The standard set of ANSI codes for mudlib use.#define ESC   ""
#define CSI ESC + "["/*  Foreground Colors  */#define BLK ESC+"[30m"          /* Black    */
#define RED ESC+"[31m"          /* Red      */
#define GRN ESC+"[32m"          /* Green    */
#define YEL ESC+"[33m"          /* Yellow   */
#define BLU ESC+"[34m"          /* Blue     */
#define MAG ESC+"[35m"          /* Magenta  */
#define CYN ESC+"[36m"          /* Cyan     */
#define WHT ESC+"[37m"          /* White    *//*   Hi Intensity Foreground Colors   */#define HIR ESC+"[1;31m"        /* Red      */
#define HIG ESC+"[1;32m"        /* Green    */
#define HIY ESC+"[1;33m"        /* Yellow   */
#define HIB ESC+"[1;34m"        /* Blue     */
#define HIM ESC+"[1;35m"        /* Magenta  */
#define HIC ESC+"[1;36m"        /* Cyan     */
#define HIW ESC+"[1;37m"        /* White    *//* High Intensity Background Colors  */#define HBRED ESC+"[41;1m"       /* Red      */
#define HBGRN ESC+"[42;1m"       /* Green    */
#define HBYEL ESC+"[43;1m"       /* Yellow   */
#define HBBLU ESC+"[44;1m"       /* Blue     */
#define HBMAG ESC+"[45;1m"       /* Magenta  */
#define HBCYN ESC+"[46;1m"       /* Cyan     */
#define HBWHT ESC+"[47;1m"       /* White    *//*  Background Colors  */#define BBLK ESC+"[40m"          /* Black    */
#define BRED ESC+"[41m"          /* Red      */
#define BGRN ESC+"[42m"          /* Green    */
#define BYEL ESC+"[43m"          /* Yellow   */
#define BBLU ESC+"[44m"          /* Blue     */
#define BMAG ESC+"[45m"          /* Magenta  */
#define BCYN ESC+"[46m"          /* Cyan     */
// #define BWHT ESC+"[47m"          /* White    */#define NOR ESC+"[2;37;0m"      /* Puts everything back to normal *//*  Additional ansi Esc codes added to ansi.h by Gothic  april 23,1993 */
/* Note, these are Esc codes for VT100 terminals, and emmulators */
/*       and they may not all work within the mud               */#define BOLD ESC+"[1m"          /* Turn on bold mode */
#define CLR ESC+"[2J"           /* Clear the screen  */
#define HOME ESC+"[H"           /* Send cursor to home position */
#define REF CLR+HOME            /* Clear screen and home cursor */
#define BIGTOP ESC+"#3"         /* Dbl height characters, top half */
#define BIGBOT ESC+"#4"         /* Dbl height characters, bottem half */
#define SAVEC ESC+"[s"           /* Save cursor position */
#define REST ESC+"[u"            /* Restore cursor to saved position */
//#define REVINDEX ESC+"M"        /* Scroll screen in opposite direction */
#define SINGW ESC+"#5"          /* Normal, single-width characters */
#define DBL ESC+"#6"            /* Creates double-width characters */
#define FRTOP ESC+"[2;25r"      /* Freeze top line */
#define FRBOT ESC+"[1;24r"      /* Freeze bottom line */
#define UNFR ESC+"[r"           /* Unfreeze top and bottom lines */
#define BLINK ESC+"[5m"         /* Initialize blink mode */
#define U ESC+"[4m"             /* Initialize underscore mode */
#define REV ESC+"[7m"           /* Turns reverse video mode on */
#define HIREV ESC+"[1,7m"       /* Hi intensity reverse video  */

zmud中的ansi颜色使用相关推荐

  1. ANSI颜色字体一篇通

    ANSI 以及颜色编码 ANSI 是一种字符编码, 其扩展了ASCII 编码. ANSI 可以实现在终端输出带有颜色的字体,这里的终端有很多,典型的就是Linux 的命名终端,另外Eclipse在安装 ...

  2. iOS 改变字符串中数字的颜色

    匹配中文字符 [\u4e00-\u9fa5] 匹配双字节字符(包括汉字在内) [^\x00-\xff] 匹配网址:[a-zA-z]+://[^\s]* 匹配国内电话 \d{3}-\d{8}|\d{4} ...

  3. 四、Input框改placeholder中字体的颜色

    Input框改placeholder中字体的颜色 input::-webkit-input-placeholder { color: #ccc; font-size: 12px; } 转载于:http ...

  4. R语言plotly包可视化线图(line plot)、使用restyle参数自定义设置可视化结果中线条的颜色、使用按钮动态切换线条的颜色(change line color with button)

    R语言plotly包可视化线图(line plot).使用restyle参数自定义设置可视化结果中线条的颜色.使用按钮动态切换线条的颜色(change line color with button i ...

  5. python使用openCV加载图像、并将BGR格式转换成HSV格式、定义HSV格式中需要分离颜色的掩码(掩模)区间(mask)、并使用mask信息进行颜色分离、BGR格式的图像转化为RGB、并可视化

    python使用openCV加载图像.并将BGR格式转换成HSV格式.定义HSV格式中需要分离颜色的掩码(掩模)区间(mask).并使用mask信息进行颜色分离.将BGR格式的图像转化为RGB.可视化 ...

  6. 使用selector修改TextView中字体的颜色

    selector想必大家都用过了,但是在修改字体的颜色的时候还是要细心. 我们在TextView中设置字体颜色一般使用 android:textColor="@color/red" ...

  7. 如何在不使用任何图像或跨度标签的情况下通过CSS在UL / LI html列表中设置子弹颜色[复制]

    本文翻译自:How to set Bullet colors in UL/LI html lists via CSS without using any images or span tags [du ...

  8. android 颜色资源文件,android中colors.xml颜色设置资源文件的方法

    1. 打开res目录下的values文件夹,双击打开colors.xml文件进行编辑 上代码 #008577 #00574B #D81B60 #ff0000 #0000ff 2. 在res目录下的la ...

  9. HTML设置字体颜色1008无标题,如何在HTML中设置字体颜色,你知道这几种方式吗?...

    color设置字体颜色 在color设置字体颜色之前,我们首先了解color在css中有几种取值方式,一共有4种方式,若有不全还请在评论区告知谢谢,4种方式如下: 十六进制.十进制. 英文单词.十六进 ...

  10. python3颜色代码_python3中布局背景颜色代码分析

    我们想要给某个模块着重突出,以便引起大家注意的时候,通常给那个模块的背景颜色换亮一点.这种情况的操作多见于我们想要突出表格中的某个数据,或是某一项的名称. 在python3中设置布局背景颜色需要通过代 ...

最新文章

  1. 快速给shell脚本加上使用提示
  2. 文件处理命令:sed
  3. 三星android pro,够大才能爽 三星Galaxy Note Pro评测
  4. 很开心收到了Andreas Loew发给我的注册key
  5. clock_gettime获取时间
  6. Linux 用户管理命令id、su
  7. docker——三剑客之Docker Machine
  8. [html] 写页面布局时需要考虑哪些方面的因素?
  9. 一起谈.NET技术,WPF Ribbon 开发资料分享
  10. 将ESXi加入到vCenter中进行管理
  11. axios请求跨域前端解决_前端跨域请求axios里面withCredentials: true
  12. Python中for循环之range、enumerate函数
  13. 长文解析Resnet50的算法原理
  14. iptable 简析
  15. 容器用干燥剂的全球与中国市场2022-2028年:技术、参与者、趋势、市场规模及占有率研究报告
  16. 宿命论與自由意志 ---霍金
  17. 使用 Vscode +PlantUml 画uml图
  18. 《问题笔记》【Visual Studio】 webView.LoadUrl(“file:///android_asset/mypage.html“)本地页面出现Invalid file path情况
  19. 知识图谱系列-2-知识图谱发展历程及其分类
  20. java随机星星怎么闪_实现星星闪动的java代码

热门文章

  1. C3AE人脸年龄识别算法
  2. 【Spring】 No qualifying bean of type ‘java.lang.String‘ available: expected at least 1 bean which qua
  3. go.js 删除节点
  4. 为什么CAN总线支线长度不能太长?
  5. 2019/04/15 在调试https://blog.csdn.net/hjw2719/article/details/83473199中程序时出现的问题
  6. Arduino ESP8266利用定时器中断控制LED闪烁示例程序
  7. geekeyes kali安装edb
  8. 再不跳槽,应届毕业生拿的都比我多了!
  9. 关于高速光耦6n137的使用总结_高速光耦6n137典型应用电路图汇总(多谐振荡/光电隔离器/光耦开关)...
  10. Pack up your loved ones 带上至亲至爱