富文本中文绘制GM8脚本 脚本
caohaozhe 发表于 2019-08-24 11:35:30 215

示例图 示例图

今天依然是一个脚本!(这个脚本是外国人写的,我给简单加了个中文支持) 注意需要先准备好FW插件!

draw_text_rtf script 原作 Miah_84.
修改 csanyk.
中文支持 豆芽酱 This script may be used or modified freely, no attribution needed. draw_text_rtf(x, y, string, regular_font, bold_font, italic_font, bold_italic_font) Description: Draws a formatted string using BBCode-like syntax for internal formatting within the string. 介绍:使用文本内部的类似BBCode的语法来绘制格式化字符串 Returns: void 返回值:无 Caution: Only works for halign==left. Not intended to draw centered or right-aligned text. 注意:只可以左对齐注意:只可以左对齐

参数说明: 参数0:x 参数1:y 参数2:文字 参数3:常规字体 参数4:加粗字体 参数5:斜体字体 参数6:粗斜字体

格式说明: 粗体字 斜体字 [c=66CCFF]RGB彩色字(大小写无瓜)[/c] [c=White]彩色字(大小写无瓜)[/c]//PS:字体名称可以在看到 下划线字

脚本代码:

/*
draw_text_rtf script
原作 Miah_84.  

修改 csanyk.  

中文支持 豆芽酱

This script may be used or modified freely, no attribution needed.

draw_text_rtf(x, y, string, regular_font, bold_font, italic_font, bold_italic_font)

Description: Draws a formatted string using BBCode-like syntax for internal formatting within the string.
介绍:使用文本内部的类似BBCode的语法来绘制格式化字符串
Returns: void
返回值:无
Caution:  Only works for halign==left.  Not intended to draw centered or right-aligned text.
注意:只可以左对齐

参数说明:
参数0:x
参数1:y
参数2:文字
参数3:常规字体
参数4:加粗字体
参数5:斜体字体
参数6:粗斜字体
格式说明:
[b]粗体字[/b]
[i]斜体字[/i]
[c=66CCFF]RGB彩色字(大小写无瓜)[/c]
[c=White]彩色字(大小写无瓜)[/c]//PS:字体名称可以在[img]http://i.msdn.microsoft.com/dynimg/IC210551.png[/img]看到
[u]下划线字[/u]
*/

/*
local var definitions
变量定义
next_x, next_y      : the x and y position of the next substring of the formatted RTF draw
rtf_x, rtf_y        : the x and y position of the rtf string
str                 : the raw rtf string, with syntax formatting awaiting parsing;
f_r, f_b, f_i, f_bi : the index of regular, bold, italic, and bold italic fonts
mode                : a control flag that sets the mode that the parser is currently operating in, eg regular, bold, italic, bold&italic
original_color      : temp storage of the original drawing color, so that the function can revert back to it when needed
i, j                : for loop iterator, re-used several times throughout the function
sc3                 : a lowercase length-3 substring of str, used to parse tags of the formatting syntax
sc4                 : a lowercase length-4 substring of str, used to parse tags of the formatting syntax
sc5                 : a lowercase length-5 substring of str, used to parse tags of the formatting syntax
sc6                 : a lowercase length-6 substring of str, used to parse tags of the formatting syntax
sa, sb              : sub-strings of str, which when concatenated together, yield a string equal to str,
//                    omitting a formatting tag.
//                    Used in building the parsed rtf string
h_r, h_g, h_b       : the hex values of a RGB color, broken into the red, green, and blue values
d_r, d_g, d_b       : the dec values of a RGB color, broken into the red, green, and blue values
rgb                 : sub-strings of str to get values for r,g,b
r,g,b               : sub-strings of rgb for individual red, green, blue values
p1, p2              : the first and second digits of a 2-digit hex value for a given RGB color channel
w                   : "which" color does the hex belong to. A temporary variable used to build the color for the color markup syntax
col_map             : a ds_map of the rtf string containing info about the color formatting
rtf_map             : a ds_map of the rtf string containing info about the bold and italic formatting
names               : a ds_list of the names used for c_NamedColor
hv                  : a ds_list of the hex values associated with the names ds_list
cn                  : a substring of str that gets the c_NamedColor value
hex_str             : a string from ds_list hv that corresponds with c_NamedColor from the ds_list names
ul                  : "underline" boolean for use with [u] and [/u] to be used in ul_map
ul_map              : a ds_map for the underline variable that keeps a list of underline

The ds_maps are used in the last for loop to actually build the markup sentence. Each character is assigned a color and font style using these. this helps to layout the placement for the next character and provide the correct color and format for each character.
*/
var next_x, next_y, rtf_x, rtf_y, str, f_r, f_b, f_i, f_bi, mode, original_color, c, i, j, sc3, sc4, sc5, sc6, sa, sb, h_r, h_b, h_g, d_r, d_g, d_g, p1, p2, w, rgb, r, g, b, names, hv, cn, hex_str, ul, ul_map;

next_x = 0;
next_y = 0;

rtf_x  = argument0;
rtf_y  = argument1;
str    = argument2;

f_r    = argument3;
f_b    = argument4;
f_i    = argument5;
f_bi   = argument6;

//modes
//1 = reg
//2 = bold
//3 = italic
//4 = bold & italic
mode     = 1;
original_color = draw_get_color();
c        = original_color;
rtf_map  = ds_map_create();
col_map  = ds_map_create();
ul       = false; 
ul_map   = ds_map_create();
names    = ds_list_create();
hv       = ds_list_create(); 

ds_list_add(names,"c_AliceBlue");ds_list_add(names,"c_AntiqueWhite");ds_list_add(names,"c_Aqua");ds_list_add(names,"c_Aquamarine");ds_list_add(names,"c_Azure");ds_list_add(names,"c_Beige");ds_list_add(names,"c_Bisque");ds_list_add(names,"c_Black");ds_list_add(names,"c_BlanchedAlmond");ds_list_add(names,"c_Blue");ds_list_add(names,"c_BlueViolet");ds_list_add(names,"c_Brown");ds_list_add(names,"c_BurlyWood");ds_list_add(names,"c_CadetBlue");ds_list_add(names,"c_Chatreuse");ds_list_add(names,"c_Chocolate");ds_list_add(names,"c_Coral");ds_list_add(names,"c_CornFlowerBlue");ds_list_add(names,"c_Cornsilk");ds_list_add(names,"c_Crimson");ds_list_add(names,"c_Cyan");ds_list_add(names,"c_DarkBlue");ds_list_add(names,"c_DarkCyan");ds_list_add(names,"c_DarkGoldenrod");ds_list_add(names,"c_DarkGrey");ds_list_add(names,"c_DarkGreen");ds_list_add(names,"c_DarkKhaki");ds_list_add(names,"c_DarkMagenta");ds_list_add(names,"c_DarkOliveGreen");ds_list_add(names,"c_DarkOrange");ds_list_add(names,"c_DarkOrchid");ds_list_add(names,"c_DarkRed");ds_list_add(names,"c_DarkSalmon");ds_list_add(names,"c_DarkSeaGreen");ds_list_add(names,"c_DarkSlateBlue");ds_list_add(names,"c_DarkSlateGrey");ds_list_add(names,"c_DarkTurquoise");ds_list_add(names,"c_DarkViolet");ds_list_add(names,"c_DeepPink");ds_list_add(names,"c_DeepSkyBlue");ds_list_add(names,"c_DimGrey");ds_list_add(names,"c_DodgerBlue");ds_list_add(names,"c_Firebrick");ds_list_add(names,"c_FloralWhite");ds_list_add(names,"c_ForestGreen");ds_list_add(names,"c_Fuchsia");ds_list_add(names,"c_Gainsboro");ds_list_add(names,"c_GhostWhite");ds_list_add(names,"c_Gold");ds_list_add(names,"c_Goldenrod");ds_list_add(names,"c_Grey");ds_list_add(names,"c_Green");ds_list_add(names,"c_GreenYellow");ds_list_add(names,"c_Honeydew");ds_list_add(names,"c_HotPink");ds_list_add(names,"c_IndianRed");ds_list_add(names,"c_Indigo");ds_list_add(names,"c_Ivory");ds_list_add(names,"c_Khaki");ds_list_add(names,"c_Lavender");ds_list_add(names,"c_LavenderBlush");ds_list_add(names,"c_LawnGreen");ds_list_add(names,"c_LemonChiffon");ds_list_add(names,"c_LightBlue");ds_list_add(names,"c_LightCoral");ds_list_add(names,"c_LightCyan");ds_list_add(names,"c_LightGoldenrodYellow");ds_list_add(names,"c_LigntGray");ds_list_add(names,"c_LightGreen");ds_list_add(names,"c_LightPink");ds_list_add(names,"c_LightSalmon");ds_list_add(names,"c_LightSeaGreen");ds_list_add(names,"c_LightSkyBlue");ds_list_add(names,"c_LightSlateGrey");ds_list_add(names,"c_LightSteelBlue");ds_list_add(names,"c_LightYellow");ds_list_add(names,"c_Lime");ds_list_add(names,"c_LimeGreen");ds_list_add(names,"c_Linen");ds_list_add(names,"c_Magenta");ds_list_add(names,"c_Maroon");ds_list_add(names,"c_MediumAquamarine");ds_list_add(names,"c_MediumBlue");ds_list_add(names,"c_MediumOrchid");ds_list_add(names,"c_MediumPurple");ds_list_add(names,"c_MediumSeaGreen");ds_list_add(names,"c_MediumSlateBlue");ds_list_add(names,"c_MediumSpringGreen");ds_list_add(names,"c_MediumTurquoise");ds_list_add(names,"c_MediumVioletRed");ds_list_add(names,"c_MidnightBlue");ds_list_add(names,"c_MintCream");ds_list_add(names,"c_MistyRose");ds_list_add(names,"c_Moccasin");ds_list_add(names,"c_NavajoWhite");ds_list_add(names,"c_Navy");ds_list_add(names,"c_OldLace");ds_list_add(names,"c_Olive");ds_list_add(names,"c_OliveDrab");ds_list_add(names,"c_Orange");ds_list_add(names,"c_OrangeRed");ds_list_add(names,"c_Orchid");ds_list_add(names,"c_PaleGoldenrod");ds_list_add(names,"c_PaleGreen");ds_list_add(names,"c_PaleTurquoise");ds_list_add(names,"c_PaleVioletRed");ds_list_add(names,"c_PapayaWhip");ds_list_add(names,"c_PeachPuff");ds_list_add(names,"c_Peru");ds_list_add(names,"c_Pink");ds_list_add(names,"c_Plum");ds_list_add(names,"c_PowderBlue");ds_list_add(names,"c_Purple");ds_list_add(names,"c_Red");ds_list_add(names,"c_RosyBrown");ds_list_add(names,"c_RoyalBlue");ds_list_add(names,"c_SaddleBrown");ds_list_add(names,"c_Salmon");ds_list_add(names,"c_SandyBrown");ds_list_add(names,"c_SeaGreen");ds_list_add(names,"c_SeaShell");ds_list_add(names,"c_Sienna");ds_list_add(names,"c_Silver");ds_list_add(names,"c_SkyBlue");ds_list_add(names,"c_SlateBlue");ds_list_add(names,"c_SlateGrey");ds_list_add(names,"c_Snow");ds_list_add(names,"c_SpringGreen");ds_list_add(names,"c_SteelBlue");ds_list_add(names,"c_Tan");ds_list_add(names,"c_Teal");ds_list_add(names,"c_Thistle");ds_list_add(names,"c_Tomato");ds_list_add(names,"c_Turquoise");ds_list_add(names,"c_Violet");ds_list_add(names,"c_Wheat");ds_list_add(names,"c_White");ds_list_add(names,"c_WhiteSmoke");ds_list_add(names,"c_Yellow");ds_list_add(names,"c_YellowGreen")
ds_list_add(hv,"F0F8FF");ds_list_add(hv,"FAEBD7");ds_list_add(hv,"00FFFF");ds_list_add(hv,"7FFFD4");ds_list_add(hv,"F0FFFF");ds_list_add(hv,"F5F5DC");ds_list_add(hv,"FFE4C4");ds_list_add(hv,"000000");ds_list_add(hv,"FFEBCD");ds_list_add(hv,"0000FF");ds_list_add(hv,"8A3BE2");ds_list_add(hv,"A52A2A");ds_list_add(hv,"DEB887");ds_list_add(hv,"5F9EA0");ds_list_add(hv,"7FFF00");ds_list_add(hv,"D2691E");ds_list_add(hv,"FF7F50");ds_list_add(hv,"6495ED");ds_list_add(hv,"FFF8DC");ds_list_add(hv,"DC143C");ds_list_add(hv,"00FFFF");ds_list_add(hv,"00008B");ds_list_add(hv,"008B8B");ds_list_add(hv,"B8860B");ds_list_add(hv,"A9A9A9");ds_list_add(hv,"006400");ds_list_add(hv,"BDB76B");ds_list_add(hv,"8B008B");ds_list_add(hv,"556B2F");ds_list_add(hv,"FF8C00");ds_list_add(hv,"9932CC");ds_list_add(hv,"8B0000");ds_list_add(hv,"E9967A");ds_list_add(hv,"8FBC8F");ds_list_add(hv,"483D8B");ds_list_add(hv,"2F4F4F");ds_list_add(hv,"00CED1");ds_list_add(hv,"9400D3");ds_list_add(hv,"FF1493");ds_list_add(hv,"00BFFF");ds_list_add(hv,"696969");ds_list_add(hv,"1E90FF");ds_list_add(hv,"B22222");ds_list_add(hv,"FFFAF0");ds_list_add(hv,"228B22");ds_list_add(hv,"FF00FF");ds_list_add(hv,"DCDCDC");ds_list_add(hv,"F8F8FF");ds_list_add(hv,"FFD700");ds_list_add(hv,"DAA520");ds_list_add(hv,"808080");ds_list_add(hv,"008000");ds_list_add(hv,"ADFF2F");ds_list_add(hv,"F0FFF0");ds_list_add(hv,"FF69B4");ds_list_add(hv,"CD5C5C");ds_list_add(hv,"4B008C");ds_list_add(hv,"FFFFF0");ds_list_add(hv,"F0E68C");ds_list_add(hv,"E6E6FA");ds_list_add(hv,"FFF0F5");ds_list_add(hv,"7CFC00");ds_list_add(hv,"FFFACD");ds_list_add(hv,"ADD8E6");ds_list_add(hv,"F08080");ds_list_add(hv,"E0FFFF");ds_list_add(hv,"FAFAD2");ds_list_add(hv,"D3D3D3");ds_list_add(hv,"90EE90");ds_list_add(hv,"FFB6C1");ds_list_add(hv,"FFA07A");ds_list_add(hv,"20B2AA");ds_list_add(hv,"87CEFA");ds_list_add(hv,"778899");ds_list_add(hv,"B0C4DE");ds_list_add(hv,"FFFFE0");ds_list_add(hv,"00FF00");ds_list_add(hv,"32CD32");ds_list_add(hv,"FAF0E6");ds_list_add(hv,"FF00FF");ds_list_add(hv,"800000");ds_list_add(hv,"66CDAA");ds_list_add(hv,"0000CD");ds_list_add(hv,"BA55D3");ds_list_add(hv,"9370DB");ds_list_add(hv,"3CB371");ds_list_add(hv,"7B68EE");ds_list_add(hv,"00FA9A");ds_list_add(hv,"48D1CC");ds_list_add(hv,"C71585");ds_list_add(hv,"191970");ds_list_add(hv,"F5FFFA");ds_list_add(hv,"FFE4E1");ds_list_add(hv,"FFFE4B5");ds_list_add(hv,"FFDEAD");ds_list_add(hv,"000080");ds_list_add(hv,"FDF5E6");ds_list_add(hv,"808000");ds_list_add(hv,"6B8E23");ds_list_add(hv,"FFA500");ds_list_add(hv,"FF4500");ds_list_add(hv,"DA70D6");ds_list_add(hv,"EEE8AA");ds_list_add(hv,"98FB98");ds_list_add(hv,"AFEEEE");ds_list_add(hv,"DB7093");ds_list_add(hv,"FFEFD5");ds_list_add(hv,"FFDAB9");ds_list_add(hv,"CD8D3F");ds_list_add(hv,"FFC0CB");ds_list_add(hv,"DDA0DD");ds_list_add(hv,"B0E0E6");ds_list_add(hv,"800080");ds_list_add(hv,"FF000");ds_list_add(hv,"BC8F8F");ds_list_add(hv,"4169E1");ds_list_add(hv,"8B4513");ds_list_add(hv,"FA8072");ds_list_add(hv,"F4A460");ds_list_add(hv,"2E8B57");ds_list_add(hv,"FFF5EE");ds_list_add(hv,"A0522D");ds_list_add(hv,"C0C0C0");ds_list_add(hv,"87CEEB");ds_list_add(hv,"6A5ACD");ds_list_add(hv,"708090");ds_list_add(hv,"FFFAFA");ds_list_add(hv,"00FF7F");ds_list_add(hv,"4682B4");ds_list_add(hv,"D2B4EC");ds_list_add(hv,"008080");ds_list_add(hv,"D88FD8");ds_list_add(hv,"FF6347");ds_list_add(hv,"40E0D0");ds_list_add(hv,"EE82EE");ds_list_add(hv,"F5DEB3");ds_list_add(hv,"FFFFFF");ds_list_add(hv,"F5F5F5");ds_list_add(hv,"FFFF00");ds_list_add(hv,"9ACD32")

for(i = 0; i <= string_length(str); i+=1){
    sc3 = string_lower(string_copy(str, i, 3));
    sc4 = string_lower(string_copy(str, i, 4));
    sc5 = string_lower(string_copy(str, i, 5));
    sc6 = string_lower(string_copy(str, i ,6));
    if(sc3 == "[b]"){
        if(mode == 1){mode = 2;}
        if(mode == 3){mode = 4;}
        sa = string_copy(str, 0, i-1);
        sb = string_copy(str, i+4, string_length(str) - i - 2);
        str = sa + sb;
        i-=1;
    }
    if(sc4 = "[/b]"){
        if(mode == 2){mode = 1;}
        if(mode == 4){mode = 3;}
        sa = string_copy(str, 0, i-1);
        sb = string_copy(str, i+4, string_length(str) - i - 3);
        str = sa + sb;
        i-=1;
    }
    if(sc3 == "[i]"){
        if(mode == 1){mode = 3;}
        if(mode == 2){mode = 4;}
        sa = string_copy(str, 0, i-1);
        sb = string_copy(str, i+3, string_length(str) - i - 2);
        str = sa + sb;
        i-=1;
    }
    if(sc4 == "[/i]"){
        if(mode == 3){mode=1;}
        if(mode == 4){mode=2;}
        sa = string_copy(str, 0, i-1);
        sb = string_copy(str, i+4, string_length(str) - i - 3);
        str = sa + sb;
        i-=1;
    }
    ds_map_add(col_map, i - 1, c);
    if(sc3 == "[c=" && sc5 != "[c=c_"){
        h_r = string_copy(str, i + 3, 2);
        h_g = string_copy(str, i + 5, 2);
        h_b = string_copy(str, i + 7, 2);
        for(j = 0; j <= 2; j+=1){
            switch(j){
                case 0: w = h_r; break;
                case 1: w = h_g; break;
                case 2: w = h_b; break;
            }
            p1 = string_lower(string_char_at(w, 1));
            if(p1 == "a"){p1 = "10";}
            if(p1 == "b"){p1 = "11";}
            if(p1 == "c"){p1 = "12";}
            if(p1 == "d"){p1 = "13";}
            if(p1 == "e"){p1 = "14";}
            if(p1 == "f"){p1 = "15";}
            dec = real(p1) * 16;
            p2 = string_lower(string_char_at(w, 2));
            if(p2 == "a"){p2 = "10";}
            if(p2 == "b"){p2 = "11";}
            if(p2 == "c"){p2 = "12";}
            if(p2 == "d"){p2 = "13";}
            if(p2 == "e"){p2 = "14";}
            if(p2 == "f"){p2 = "15";}
            dec += real(p2);
            switch(j){
                case 0: d_r = dec; break;
                case 1: d_g = dec; break;
                case 2: d_b = dec; break;
            }
        }
        c = make_color_rgb(d_r, d_g, d_b);
        ds_map_replace(col_map, i, c);
        str = string_replace(str,"[c=" + h_r + h_g + h_b + "]", ""); //only replaces the first one, not all
        i-=1;
    }
    if(sc5 == "[c=c_"){
     cn = string_copy(str,i,32)//random length, long enough to cover all names

     cn = string_replace(cn,"[c=","")
     cn = string_copy(cn,0,string_pos("]",cn)-1)

     for(j=0;j<ds_list_size(names);j+=1){
      if(cn == ds_list_find_value(names,j)){
       hex_str = ds_list_find_value(hv,j)
      }
     }
        h_r = string_copy(hex_str, 1, 2);
        h_g = string_copy(hex_str, 3, 2);
        h_b = string_copy(hex_str, 5, 2);
        for(j = 0; j <= 2; j+=1){
            switch(j){
                case 0: w = h_r; break;
                case 1: w = h_g; break;
                case 2: w = h_b; break;
            }
            p1 = string_lower(string_char_at(w, 1));
            if(p1 == "a"){p1 = "10";}
            if(p1 == "b"){p1 = "11";}
            if(p1 == "c"){p1 = "12";}
            if(p1 == "d"){p1 = "13";}
            if(p1 == "e"){p1 = "14";}
            if(p1 == "f"){p1 = "15";}
            dec = real(p1) * 16;
            p2 = string_lower(string_char_at(w, 2));
            if(p2 == "a"){p2 = "10";}
            if(p2 == "b"){p2 = "11";}
            if(p2 == "c"){p2 = "12";}
            if(p2 == "d"){p2 = "13";}
            if(p2 == "e"){p2 = "14";}
            if(p2 == "f"){p2 = "15";}
            dec += real(p2);
            switch(j){
                case 0: d_r = dec; break;
                case 1: d_g = dec; break;
                case 2: d_b = dec; break;
            }
        }
        c = make_color_rgb(d_r, d_g, d_b);
        ds_map_replace(col_map, i, c);
        str = string_replace(str,"[c=" + cn + "]", ""); //only replaces the first one, not all
        i-=1;     
    }
    if(sc4 == "[/c]"){
        c = original_color;
        ds_map_replace(col_map, i, c);
        sa = string_copy(str, 0, i - 1);
        sb = string_copy(str, i + 4, string_length(str) - i - 3);
        str = sa + sb;
        i-=1;
    }
    if(sc5 == "[rgb="){
        rgb = string_copy(str,i,17)
        rgb = string_copy(rgb,0,string_pos("]",rgb)-1)
        rgb = string_replace(rgb,"[rgb=","")
        r = string_copy(rgb,0,string_pos(",",rgb)-1)
        rgb = string_replace(rgb,r+",","")
        g = string_copy(rgb,0,string_pos(",",rgb)-1)
        rgb = string_replace(rgb,g+",","")
        b = rgb
        c = make_color_rgb(real(r), real(g), real(b));
        ds_map_replace(col_map, i, c);
        str = string_replace(str,"[rgb=" + r + "," + g + "," + b + "]", ""); //only replaces the first one, not all
        i-=1;
    }
    if(sc6 == "[/rgb]"){
        c = original_color;
        ds_map_replace(col_map, i, c);
        sa = string_copy(str, 0, i - 1);
        sb = string_copy(str, i + 6, string_length(str) - i - 5);
        str = sa + sb;
        i-=1;
    }
    ds_map_add(rtf_map, i, mode);
    ds_map_add(ul_map,i,ul);
    if(sc3 == "[u]"){
        ds_map_replace(ul_map,i,!ul);
        ul = !ul;
        sa = string_copy(str, 0, i-1);
        sb = string_copy(str, i+3, string_length(str) - i - 2);
        str = sa + sb;
        i-=1;
    }
    if(sc4 == "[/u]"){
        ds_map_replace(ul_map,i,!ul);
        ul = !ul;
        sa = string_copy(str, 0, i-1);
        sb = string_copy(str, i+4, string_length(str) - i - 3);
        str = sa + sb;
        i-=1;
    }
}

for(i = 1; i <= string_length(str); i+=1){
    var num;
    num=0
    if(ord(string_copy(str, i, 1))>128)
    {
        num=2
    }
    else
    {
        num=1
    }
    if(string_copy(str, i, 1) == chr(10)){next_x = 0; next_y += fw_string_height(chr(10));}
    draw_set_color(ds_map_find_value(col_map, i));
    if(ds_map_find_value(ul_map,i)){
     draw_line(rtf_x + next_x, rtf_y + next_y + fw_string_height("|"), rtf_x + next_x + fw_string_width(string_copy(str,i,num)), rtf_y + next_y + fw_string_height("|"))
    }
    switch(ds_map_find_value(rtf_map, i)){
        case 1:
        fw_draw_set_font(f_r);
        fw_draw_text(rtf_x + next_x, rtf_y + next_y, string_copy(str, i, num));
        next_x += fw_string_width(string_copy(str, i, num));
        break;
        case 2:
        fw_draw_set_font(f_b);
        fw_draw_text(rtf_x + next_x, rtf_y + next_y, string_copy(str, i, num));
        next_x += fw_string_width(string_copy(str, i, num));
        break;
        case 3:
        fw_draw_set_font(f_i);
        fw_draw_text(rtf_x + next_x, rtf_y + next_y, string_copy(str, i, num));
        next_x += fw_string_width(string_copy(str, i, num));
        break;
        case 4:
        fw_draw_set_font(f_bi);
        fw_draw_text(rtf_x + next_x, rtf_y + next_y, string_copy(str, i, num));
        next_x += fw_string_width(string_copy(str, i, num));
        break;
    }//end switch
    i+=num-1
}

//reset color
draw_set_color(original_color);
//free up the ds_maps and ds_lists
ds_map_destroy(rtf_map);
ds_map_destroy(col_map);
ds_map_destroy(ul_map);
ds_list_destroy(names);
ds_list_destroy(hv);
最新回复 (1)
  • GM2_student 发表于 2019-09-02 09:43:06
    0 2
    虽然我不用GM8,但是支持