Jump to content


Photo

Html To Gml Code: Now Adds Smilies!


  • This topic is locked This topic is locked
28 replies to this topic

#1 Sandro

Sandro

    GMC Member

  • New Member
  • 184 posts

Posted 23 November 2006 - 04:18 AM

I no longer support these scripts. My new versions are now GM7 extentions and located here.

draw_html() Version 1.3


draw_html() 1.3 for GM7 Red (GMK Example)
http://www.ultimateg...er.php?file=202

draw_html() 1.3 for GM7 Reg (GML code)
http://www.ultimateg...er.php?file=204

build_html() Version 1.1
A new version of the build_html() is needed in order to include the smilies

build_html() 1.1 for GM7 Reg
http://www.ultimateg...er.php?file=203

To use build_html():
In a code action in a create event call
background0 = build_html(string,width,height,sprite)
- background0 is the name of the background
- string is the html code
- width is the width of the background
- height is the height if the background
- the sprite to be used for smilies
In a draw event call
draw_background(background0,x,y)

Since function build_html creates a background, you can do anything with it that you could do to a background. I'm not sure what other functions you would use other then draw_background(), but the others will work.

IMPORTANT: I have no intention on converting HTML to it's full extent. It's main use
is to allow easy formatting of text.

Contverts the Following HTML Tags:
<br>
<!--...-->

<b>
<i>
<u>
<s>
<strike>
<big>
<small>

<em>
<strong>
<dfn>
<code>
<samp>
<kbd>
<var>
<cite>
<del>
<ins>
<adress>
<pre>
<tt>
<q>
<acronym>
<abbr>

Converts the following Added Tags

<script> - Adds GML code

<sm> - draws a smiliey face

<font_name>Times New Roman</font_name>
<font_size>10</font_size>
<font_color>red</font_color>

<symbol-,> - adds a '<' symbol
<symbol-.> - adds a '>' symbol
<symbol-c> - adds a '©' symbol
<symbol-r> - adds a '®' symbol
<symbol-tm> - adds a '™' symbol
NOTE: Not all fonts support the added symbols

to do List
<font_align>
<symbol-pi> - adds the pi symbol
<symbol-de> - adds the degrees symbol
<img>
<a>
<link>

- fix the spelling errors
- Align to bottom of row (rather then top)
- Make a library and a GM7 extention
- Include my Word Art scripts

OPEN TO SUGGESTIONS

GM5 and GM6 draw_html() VERSION 1.2
NOTE: Old Versions are no longer supported

draw_html() 1.2 for :rolleyes: GM5.3A Unreg
http://www.ultimateg...er.php?file=169

draw_html() 1.2 for :D GM5.1 Reg
http://www.ultimateg...er.php?file=170

build_html() 1.0 for :) GM5.3A Reg
http://www.ultimateg...er.php?file=171

build_html() 1.0 for ^_^ GM6.1 Reg
http://www.ultimateg...er.php?file=172

Since the really older version are a bit faster then 1.2, Version 1.1A can be downloaded here: (You may use build_html 1.0 ABOVE)

draw_html() 1.1A for :) GM5.3A Unreg
http://www.ultimateg...er.php?file=167

draw_html() 1.1A for ;) GM6.1 Reg
http://www.ultimateg...er.php?file=168

Edited by The Shadow, 24 April 2007 - 01:46 AM.

  • 0

#2 Fedor

Fedor

    GMC Member

  • New Member
  • 294 posts

Posted 23 November 2006 - 04:29 AM

make it for GM6 too, I really like HTML :rolleyes:
  • 0

#3 Sandro

Sandro

    GMC Member

  • New Member
  • 184 posts

Posted 23 November 2006 - 04:40 AM

make it for GM6 too, I really like HTML :rolleyes:

<{POST_SNAPBACK}>

the problem with making it in GM6, is the hole import font thing. I can't change the fonts like i can in GM5 (threw code). So if I can find a way, i do it.
  • 0

#4 hughman

hughman

    GMC Member

  • GMC Member
  • 568 posts

Posted 23 November 2006 - 05:07 AM

pretty nice
good idea!
if GM6 would be possible it would be appreciated!!
  • 0

#5 coolsmile

coolsmile

    Programmer

  • New Member
  • 1346 posts

Posted 23 November 2006 - 03:33 PM

I was going to make something like this but I was too lazy, thanks for saving me time <_<, Great Job
  • 0

#6 Fedor

Fedor

    GMC Member

  • New Member
  • 294 posts

Posted 23 November 2006 - 05:08 PM

make it for GM6 too, I really like HTML <_<

<{POST_SNAPBACK}>

the problem with making it in GM6, is the hole import font thing. I can't change the fonts like i can in GM5 (threw code). So if I can find a way, i do it.

<{POST_SNAPBACK}>

I'll try converting it, if it fails I'll tell you.
  • 0

#7 Sandro

Sandro

    GMC Member

  • New Member
  • 184 posts

Posted 23 November 2006 - 06:13 PM

I'll try converting it, if it fails I'll tell you.

<{POST_SNAPBACK}>


If you didn't test the GM5 version yet you really should. The example seems to really lag on my 600mhz pc.

I'm working on a second script that will save the html page as a background. In this way the function draw_html, will only have to be called once. I'll post it when it's done.
  • 0

#8 Fedor

Fedor

    GMC Member

  • New Member
  • 294 posts

Posted 23 November 2006 - 09:53 PM

the problem is I dont have GM5.3 registered <_< only GM6.1

Edited by Fedor, 23 November 2006 - 09:53 PM.

  • 0

#9 MP2:E

MP2:E

    GMC Member

  • New Member
  • 152 posts

Posted 23 November 2006 - 10:03 PM

the problem is I dont have GM5.3 registered <_< only GM6.1

<{POST_SNAPBACK}>

You should've gotten a registration code for GM 5.3 when you ordered your 6.1 code.
I'd help with conversion, but I don't know what needs to be converted, or how to deal with the font changing problem.
  • 0

#10 OpticalLiam

OpticalLiam

    GMC Member

  • New Member
  • 782 posts

Posted 23 November 2006 - 10:51 PM

This seems... pointless.
  • 0

#11 Matt13

Matt13

    GMC Member

  • New Member
  • 580 posts
  • Version:Unknown

Posted 23 November 2006 - 10:59 PM

It is...
And 600mhz? Anything would lag <_<

Edited by Matt13, 23 November 2006 - 10:59 PM.

  • 0

#12 Knightmare

Knightmare

    OMGLOLWTFZORZ!1!1!!11

  • New Member
  • 867 posts
  • Version:Unknown

Posted 24 November 2006 - 12:00 AM

make it for GM6 too, I really like HTML <_<

<{POST_SNAPBACK}>

the problem with making it in GM6, is the hole import font thing. I can't change the fonts like i can in GM5 (threw code). So if I can find a way, i do it.

<{POST_SNAPBACK}>


font_add() function in gm6.1...
  • 0


#13 Sandro

Sandro

    GMC Member

  • New Member
  • 184 posts

Posted 24 November 2006 - 02:24 AM

font_add() function in gm6.1...

<{POST_SNAPBACK}>


- WOW, that will work. I normally just use GM5, so I don't know all of GM6's functions. Anyway, I'll get to work on the GM6 version, and I'll try to find a way to make it faster.

@OpticalLiam
- It's only designed to increase the power of GM's draw_text function, by allowing bold, italic, underline, ect.; In the middle of a string. The only reason I used HTML is because a lot of people know it and thus would be easy to use.

@Matt13
- 600mhz is not that fast. that's only 0.6ghz compared to 2.5ghz; witch is a $300 PC right now.
- It only tends to lag when drawling larger strings

@MP2:E
- The only thing that need to be changed is the font stuff; everything else should work.

@Fedor
- The GM5 Version should work in the unregistered version, but i wouldn't count on the GM6 Version working in unregistered gamemaker

Edited by The Shadow, 24 November 2006 - 02:37 AM.

  • 0

#14 Ruby

Ruby

    Ruby Software

  • New Member
  • 203 posts

Posted 24 November 2006 - 02:20 PM

draw_html() 1.1A for  ^_^ GM5.3A Unreg
http://www.ultimateg...er.php?file=167

draw_html() 1.1A for  :GM6: GM6.1 Reg
http://www.ultimateg...er.php?file=168


Both links are DEAD!!!!!!!

:( :( :(
  • 0
No longer active on GMC

#15 CyberTwister

CyberTwister

    GMC Member

  • GMC Member
  • 246 posts

Posted 24 November 2006 - 02:56 PM

Links work

This is a nice work ^_^
You should try to work only on the gm6 version.

Good luck

(Maybe i'll try to had some few things to your script if i get time)
  • 0

#16 Sandro

Sandro

    GMC Member

  • New Member
  • 184 posts

Posted 24 November 2006 - 04:14 PM

@Ruby
- I always check my links, and both of them work. So our server must of went down of something. Anyway they work now.

@ CyberTwister
- Thanks

(Maybe i'll try to had some few things to your script if i get time)

<{POST_SNAPBACK}>

- If you could get build_html() to work that would be great. The GM5 script is in my first post, and there isn't a GM6 version at this point.

@All
- I have finished Version 1.2 and will edit the first post in a minut
- <u> and <strink> as now made with draw_line and draw_point. This allows you to have any combination of bold, italic, underline, and strike.
- In addition, the <u> and <strink> tags have been added to the GM6 version thanks to this new method.
- The downside is, this new method makes the script even slower. Witch makes me really want the build_html() script working. For those of you how still want the 1.1A versions, there still there.
- By using draw_pixal (draw_point_color in GM6), I was able to make a dotted underline and thus adding the <acronym> and <abbr> tags.

- I'm realize that theres currently no easy way to change font in the GM6 version. The best way I can think to fix that is by adding the <font> tag. I'm sorry but the <style> tag is way too much work.

Edited by The Shadow, 24 November 2006 - 04:23 PM.

  • 0

#17 Matt13

Matt13

    GMC Member

  • New Member
  • 580 posts
  • Version:Unknown

Posted 24 November 2006 - 04:46 PM

@Matt13
- 600mhz is not that fast. that's only 0.6ghz compared to 2.5ghz; witch is a $300 PC right now.
- It only tends to lag when drawling larger strings

...uhm I said that it was not fast...
  • 0

#18 Sandro

Sandro

    GMC Member

  • New Member
  • 184 posts

Posted 24 November 2006 - 05:00 PM

@Matt13
- 600mhz is not that fast. that's only 0.6ghz compared to 2.5ghz; witch is a $300 PC right now.
- It only tends to lag when drawling larger strings

...uhm I said that it was not fast...

<{POST_SNAPBACK}>

- The thing is that the example lags so much that it most likely lags on faster PCs. Just run the example and see what I mean.
  • 0

#19 Matt13

Matt13

    GMC Member

  • New Member
  • 580 posts
  • Version:Unknown

Posted 24 November 2006 - 10:51 PM

Oh I don't need to run it, by looking at the script I can guess it'll lag somewhat.
  • 0

#20 Fedor

Fedor

    GMC Member

  • New Member
  • 294 posts

Posted 25 November 2006 - 12:14 AM

the problem is I dont have GM5.3 registered :( only GM6.1

<{POST_SNAPBACK}>

You should've gotten a registration code for GM 5.3 when you ordered your 6.1 code.
I'd help with conversion, but I don't know what needs to be converted, or how to deal with the font changing problem.

<{POST_SNAPBACK}>

Oh I did get it ^_^ I just don't use it :GM6:
  • 0

#21 Sandro

Sandro

    GMC Member

  • New Member
  • 184 posts

Posted 25 November 2006 - 12:58 AM

Matt13 and Fedor, both the GM5 and GM6 versions are working (Read my first post).
But
- They are still very slow.
- The GM6 version is incapable of changing the font. I'll add the <font> tag to fix that, but I'm having problems with the string handling. If you could determine the font name, size and color, from "<font face=Times New Roman color=red size=10>" that would be great.
- I Plan to add the <sup> and <sub> tags to Version 1.3
- I can't think of an easy way to add center and left alignment; if that can be done, then the <center> and <bdo> tags can be added.

To All;
I'm nearing completion of the draw_html() function. My To Do list for this script gos as follows

Will get Done
<sup>
<sub>
<font>
build_html()

Might get Done; As long as I don't run into problems doing so.
<a>
<img>
<center>
<bdo>
lists

Won't get done; Really, There's no point in adding these features
<html>
<body>
<head>
tables
input feilds
HTML DOM
java_script
flash
and any thing else that's not stated above
  • 0

#22 MP2:E

MP2:E

    GMC Member

  • New Member
  • 152 posts

Posted 25 November 2006 - 01:05 AM

This Is great! But instead of uploading the scripts, just put them on the front page, like this:
V1.2 GM6.1 Registered:
<span style='font-size:10pt;line-height:100%'>/*(GM6) HTML to GM Version 1.2Dragon Entertainment SoftwareConverts a string into GML Codedraw_html(x,y,string)This script has been re-written to run on GM6, as a result several tags have beenremoved.Contverts the Following Tags:<br><!--...--><b><i><u><s><strike><big><small><em><strong><dfn><code><samp><kbd><var><cite><del><ins><adress><pre><tt><q><acronym><abbr><script><symbol0> - adds a '<' symbol<symbol1> - adds a '>' symbol*/<strong class='bbc'>var</strong> chr,line,endstring,font,font_size,df_font_name,temp,font_underline,font_strike;string_replace(argument2,"","")char = ""line[0,0] = 1line[0,1] = 0line[1,0] = 0line[1,1] = 10font_size = 10font = font_add("Times New Roman",10,0,0,0,255)ds_font_name = font_get_name(font)draw_set_font(font)font_underline = 0font_strike = 0endstring = argument2<strong class='bbc'>repeat</strong> (string_length(argument2))    <strong class='bbc'>{</strong>    char = string_char_at(endstring,1)    endstring = string_delete(endstring,1,1)    <strong class='bbc'>if</strong> (char = "<")        <strong class='bbc'>{</strong>        tag = string_lower(string_copy(endstring,1,string_pos(">",endstring)))        <strong class='bbc'>if</strong> (tag = "br>")            <strong class='bbc'>{</strong>            line[0,1] += line[line[0,0],1]            line[0,0] += 1            line[line[0,0],0] = 0            line[line[0,0],1] = 10            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "big>" <strong class='bbc'>or</strong> tag = "/small>")            <strong class='bbc'>{</strong>            font_size += 2            temp = font_add(font_get_name(font),font_size,font_get_bold(font),font_get_italic(font),0,255)            font_delete(font)            font = temp            draw_set_font(font)            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "/big>" <strong class='bbc'>or</strong> tag = "small>")            <strong class='bbc'>{</strong>            font_size += -2            temp = font_add(font_get_name(font),font_size,font_get_bold(font),font_get_italic(font),0,255)            font_delete(font)            font = temp            draw_set_font(font)            <strong class='bbc'>}</strong>/* Faceing Removal, due to Problems        if (tag = "bdo dir=rtl>" or tag = "/bdo>" or tag = "/center>")            {            font_angle = fa_left            }        if (tag = "center>")            {            font_align = fa_center            }        if (tag = "bdo dir=ltr>")            {            font_align = fa_left            }*/        <strong class='bbc'>if</strong> (tag = "code>" <strong class='bbc'>or</strong> tag = "samp>" <strong class='bbc'>or</strong> tag = "kbd>" <strong class='bbc'>or</strong> tag = "pre>" <strong class='bbc'>or</strong> tag = "tt>")            <strong class='bbc'>{</strong>            df_font_name = font_get_name(font)            temp = font_add("Courier New",font_size,font_get_bold(font),font_get_italic(font),0,255)            font_delete(font)            font = temp            draw_set_font(font)            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "/code>" <strong class='bbc'>or</strong> tag = "/samp>" <strong class='bbc'>or</strong> tag = "/kbd>" <strong class='bbc'>or</strong> tag = "/pre>" <strong class='bbc'>or</strong> tag = "/tt>")            <strong class='bbc'>{</strong>            temp = font_add(df_font_name,font_size,font_get_bold(font),font_get_italic(font),0,255)            font_delete(font)            font = temp            draw_set_font(font)            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "u>" <strong class='bbc'>or</strong> tag = "ins>")            <strong class='bbc'>{</strong>            font_underline = 1            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "abbr>" <strong class='bbc'>or</strong> tag = "acronym>")            <strong class='bbc'>{</strong>            font_underline = 2            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "/u>" <strong class='bbc'>or</strong> tag = "/ins>" <strong class='bbc'>or</strong> tag = "/abbr>" <strong class='bbc'>or</strong> tag = "/acronym>")            <strong class='bbc'>{</strong>            font_underline = 0            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "s>" <strong class='bbc'>or</strong> tag = "strike>" <strong class='bbc'>or</strong> tag = "del>")            <strong class='bbc'>{</strong>            font_strike = 1            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "/s>" <strong class='bbc'>or</strong> tag = "/strike>" <strong class='bbc'>or</strong> tag = "/del>")            <strong class='bbc'>{</strong>            font_strike = 0            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "b>" <strong class='bbc'>or</strong> tag = "strong>")            <strong class='bbc'>{</strong>            temp = font_add(font_get_name(font),font_size,1,font_get_italic(font),0,255)            font_delete(font)            font = temp            draw_set_font(font)            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "i>" <strong class='bbc'>or</strong> tag = "em>" <strong class='bbc'>or</strong> tag = "dfn>" <strong class='bbc'>or</strong> tag = "var>" <strong class='bbc'>or</strong> tag = "cite>" <strong class='bbc'>or</strong> tag = "adress>")            <strong class='bbc'>{</strong>            temp = font_add(font_get_name(font),font_size,font_get_bold(font),1,0,255)            font_delete(font)            font = temp            draw_set_font(font)            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "/b>" <strong class='bbc'>or</strong> tag = "/strong>")            <strong class='bbc'>{</strong>            temp = font_add(font_get_name(font),font_size,0,font_get_italic(font),0,255)            font_delete(font)            font = temp            draw_set_font(font)            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "/i>" <strong class='bbc'>or</strong> tag = "/em>" <strong class='bbc'>or</strong> tag = "/dfn>" <strong class='bbc'>or</strong> tag = "/var>" <strong class='bbc'>or</strong> tag = "/cite>" <strong class='bbc'>or</strong> tag = "/adress>")            <strong class='bbc'>{</strong>            temp = font_add(font_get_name(font),font_size,font_get_bold(font),0,0,255)            font_delete(font)            font = temp            draw_set_font(font)            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "symbol0>")            <strong class='bbc'>{</strong>            draw_text(argument0+line[line[0,0],0],argument1+line[0,1],"<")            line[line[0,0],0] += string_width("<")            <strong class='bbc'>if</strong> (string_height("<") > line[line[0,0],1]) line[line[0,0],1] = string_height("<")            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "symbol1>")            <strong class='bbc'>{</strong>            draw_text(argument0+line[line[0,0],0],argument1+line[0,1],">")            line[line[0,0],0] += string_width(">")            <strong class='bbc'>if</strong> (string_height(">") > line[line[0,0],1]) line[line[0,0],1] = string_height(">")            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "script>")            <strong class='bbc'>{</strong>            <strong class='bbc'>if</strong> (string_pos("</script>",endstring) != 0)                <strong class='bbc'>{</strong>                <strong class='bbc'>var</strong> value;                value = string_delete(endstring,1,string_length(tag))                value = string_copy(value,1,string_pos("</script>",value)-1)                execute_string(value)                endstring = string_delete(endstring,1,string_pos("</script>",endstring)+string_length("</script>")-1)                <strong class='bbc'>}</strong>                <strong class='bbc'>else</strong>                <strong class='bbc'>{</strong>                endstring = string_delete(endstring,1,string_length(tag))                <strong class='bbc'>}</strong>            <strong class='bbc'>}</strong>            <strong class='bbc'>else</strong>            <strong class='bbc'>{</strong>            endstring = string_delete(endstring,1,string_length(tag))            <strong class='bbc'>}</strong>        <strong class='bbc'>}</strong>        <strong class='bbc'>else</strong>        <strong class='bbc'>{</strong>        draw_text(argument0+line[line[0,0],0],argument1+line[0,1],char)        <strong class='bbc'>if</strong> (font_underline = 2)            <strong class='bbc'>{</strong>            <strong class='bbc'>var</strong> value;            value = argument0+line[line[0,0],0]            <strong class='bbc'>repeat</strong> (string_width(char)/2)                <strong class='bbc'>{</strong>                draw_point_color(value,argument1+line[0,1]+string_height(char)-2,c_green)                value += 2                <strong class='bbc'>}</strong>            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (font_underline = 1) draw_line(argument0+line[line[0,0],0],argument1+line[0,1]+string_height(char)-2,argument0+line[line[0,0],0]+string_width(char),argument1+line[0,1]+string_height(char)-2)        <strong class='bbc'>if</strong> (font_strike = 1) draw_line(argument0+line[line[0,0],0],argument1+line[0,1]+(string_height(char)/2),argument0+line[line[0,0],0]+string_width(char),argument1+line[0,1]+(string_height(char)/2))        line[line[0,0],0] += string_width(char)        <strong class='bbc'>if</strong> (string_height(char) > line[line[0,0],1]) line[line[0,0],1] = string_height(char)        <strong class='bbc'>}</strong>    <strong class='bbc'>}</strong></span>
v1.12 GM5.3A:
[font="Courier New"]<span style='font-size:10pt;line-height:100%'>/*(GM5) HTML to GM Version 1.2Dragon Entertainment SoftwareConverts a string into GML Codedraw_html(x,y,string)Contverts the Following Tags:<br><!--...--><b><i><u><s><strike><big><small><em><strong><dfn><code><samp><kbd><var><cite><del><ins><adress><pre><tt><q><acronym><abbr><script><symbol0> - adds a '<' symbol<symbol1> - adds a '>' symbol*/<strong class='bbc'>var</strong> chr,line,endstring,df_font_name,ds_font_size,df_font_color,df_font_style,font_underline,font_strike;string_replace(argument2,"","")char = ""line[0,0] = 1line[0,1] = 0line[1,0] = 0line[1,1] = font_sizedf_font_name = font_namedf_font_size = font_sizedf_font_color = font_colordf_font_style = font_stylefont_underline = 0font_strike = 0endstring = argument2<strong class='bbc'>repeat</strong> (string_length(argument2))    <strong class='bbc'>{</strong>    char = string_char_at(endstring,1)    endstring = string_delete(endstring,1,1)    <strong class='bbc'>if</strong> (char = "<")        <strong class='bbc'>{</strong>        tag = string_lower(string_copy(endstring,1,string_pos(">",endstring)))        <strong class='bbc'>if</strong> (tag = "br>")            <strong class='bbc'>{</strong>            line[0,1] += line[line[0,0],1]            line[0,0] += 1            line[line[0,0],0] = 0            line[line[0,0],1] = font_size            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "big>" <strong class='bbc'>or</strong> tag = "/small>")            <strong class='bbc'>{</strong>            font_size += 2            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "/big>" <strong class='bbc'>or</strong> tag = "small>")            <strong class='bbc'>{</strong>            font_size += -2            <strong class='bbc'>}</strong>/*        if (tag = "bdo dir=rtl>" or tag = "/bdo>" or tag = "/center>")            {            font_angle = fa_left            }        if (tag = "center>")            {            font_align = fa_center            }        if (tag = "bdo dir=ltr>")            {            font_align = fa_left            }*/        <strong class='bbc'>if</strong> (tag = "code>" <strong class='bbc'>or</strong> tag = "samp>" <strong class='bbc'>or</strong> tag = "kbd>" <strong class='bbc'>or</strong> tag = "pre>" <strong class='bbc'>or</strong> tag = "tt>")            <strong class='bbc'>{</strong>            font_name = "Courier New"            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "/code>" <strong class='bbc'>or</strong> tag = "/samp>" <strong class='bbc'>or</strong> tag = "/kbd>" <strong class='bbc'>or</strong> tag = "/pre>" <strong class='bbc'>or</strong> tag = "/tt>")            <strong class='bbc'>{</strong>            font_name = df_font_name            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "u>" <strong class='bbc'>or</strong> tag = "ins>")            <strong class='bbc'>{</strong>            font_underline = 1            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "acronym>" <strong class='bbc'>or</strong> tag = "abbr>")            <strong class='bbc'>{</strong>            font_underline = 2            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "/u>" <strong class='bbc'>or</strong> tag = "/ins>" <strong class='bbc'>or</strong> tag = "/acronym>" <strong class='bbc'>or</strong> tag = "/abbr>")            <strong class='bbc'>{</strong>            font_underline = 0            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "s>" <strong class='bbc'>or</strong> tag = "strike>" <strong class='bbc'>or</strong> tag = "del>")            <strong class='bbc'>{</strong>            font_strike = 1            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "/s>" <strong class='bbc'>or</strong> tag = "/strike>" <strong class='bbc'>or</strong> tag = "/del>")            <strong class='bbc'>{</strong>            font_strike = 0            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "b>" <strong class='bbc'>or</strong> tag = "strong>")            <strong class='bbc'>{</strong>            <strong class='bbc'>if</strong> (font_style = fs_normal) font_style = fs_bold            <strong class='bbc'>if</strong> (font_style = fs_italic) font_style = fs_bolditalic            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "i>" <strong class='bbc'>or</strong> tag = "em>" <strong class='bbc'>or</strong> tag = "dfn>" <strong class='bbc'>or</strong> tag = "var>" <strong class='bbc'>or</strong> tag = "cite>" <strong class='bbc'>or</strong> tag = "adress>")            <strong class='bbc'>{</strong>            <strong class='bbc'>if</strong> (font_style = fs_normal) font_style = fs_italic            <strong class='bbc'>if</strong> (font_style = fs_bold) font_style = fs_bolditalic            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "/b>" <strong class='bbc'>or</strong> tag = "/strong>")            <strong class='bbc'>{</strong>            <strong class='bbc'>if</strong> (font_style = fs_bold) font_style = fs_normal            <strong class='bbc'>if</strong> (font_style = fs_bolditalic) font_style = fs_italic            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "/i>" <strong class='bbc'>or</strong> tag = "/em>" <strong class='bbc'>or</strong> tag = "/dfn>" <strong class='bbc'>or</strong> tag = "/var>" <strong class='bbc'>or</strong> tag = "/cite>" <strong class='bbc'>or</strong> tag = "/adress>")            <strong class='bbc'>{</strong>            <strong class='bbc'>if</strong> (font_style = fs_italic) font_style = fs_normal            <strong class='bbc'>if</strong> (font_style = fs_bolditalic) font_style = fs_bold            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "symbol0>")            <strong class='bbc'>{</strong>            draw_text(argument0+line[line[0,0],0],argument1+line[0,1],"<")            line[line[0,0],0] += string_width("<")            <strong class='bbc'>if</strong> (string_height("<") > line[line[0,0],1]) line[line[0,0],1] = string_height("<")            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "symbol1>")            <strong class='bbc'>{</strong>            draw_text(argument0+line[line[0,0],0],argument1+line[0,1],">")            line[line[0,0],0] += string_width(">")            <strong class='bbc'>if</strong> (string_height(">") > line[line[0,0],1]) line[line[0,0],1] = string_height(">")            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "q>" <strong class='bbc'>or</strong> tag = "/q>")            <strong class='bbc'>{</strong>            draw_text(argument0+line[line[0,0],0],argument1+line[0,1],'"')            line[line[0,0],0] += string_width('"')            <strong class='bbc'>if</strong> (string_height('"') > line[line[0,0],1]) line[line[0,0],1] = string_height('"')            <strong class='bbc'>}</strong>        <strong class='bbc'>if</strong> (tag = "script>")            <strong class='bbc'>{</strong>            <strong class='bbc'>if</strong> (string_pos("</script>",endstring) != 0)                <strong class='bbc'>{</strong>                <strong class='bbc'>var</strong> value;                value = string_delete(endstring,1,string_length(tag))                value = string_copy(value,1,string_pos("</script>",value)-1)                execute_string(value)                endstring = string_delete(endstring,1,string_pos("</script>",endstring)+string_length("</script>")-1)                <strong class='bbc'>}</strong>                <strong class='bbc'>else</strong>                <strong class='bbc'>{</strong>                endstring = string_delete(endstring,1,string_length(tag))                <strong class='bbc'>}</strong>            <strong class='bbc'>}</strong>            <strong class='bbc'>else</strong>            <strong class='bbc'>{</strong>            endstring = string_delete(endstring,1,string_length(tag))            <strong class='bbc'>}</strong>        <strong class='bbc'>}</strong>        <strong class='bbc'>else</strong>        <strong class='bbc'>{</strong>        draw_text(argument0+line[line[0,0],0],argument1+line[0,1],char)        brush_color = c_green        <strong class='bbc'>if</strong> (font_underline = 2)            <strong class='bbc'>{</strong>            <strong class='bbc'>var</strong> value;            value = argument0+line[line[0,0],0]            <strong class='bbc'>repeat</strong> (string_width(char)/2)                <strong class='bbc'>{</strong>                draw_pixel(value,argument1+line[0,1]+string_height(char)-2)                value += 2                <strong class='bbc'>}</strong>            <strong class='bbc'>}</strong>        pen_color = font_color        <strong class='bbc'>if</strong> (font_underline = 1) draw_line(argument0+line[line[0,0],0],argument1+line[0,1]+string_height(char)-2,argument0+line[line[0,0],0]+string_width(char),argument1+line[0,1]+string_height(char)-2)        <strong class='bbc'>if</strong> (font_strike = 1) draw_line(argument0+line[line[0,0],0],argument1+line[0,1]+(string_height(char)/2),argument0+line[line[0,0],0]+string_width(char),argument1+line[0,1]+(string_height(char)/2))        line[line[0,0],0] += string_width(char)        <strong class='bbc'>if</strong> ([color="#000080"]string_height(char) > line[line[0,0],1]) line[line[0,0],1] = [color="#000080"]string_height(char)        <strong class='bbc'>}</strong>    <strong class='bbc'>}</strong>font_name = df_font_namefont_size = df_font_sizefont_color = df_font_colorfont_style = df_font_style</span>

And you might ask, How did you color it? ^_^
Here
Click whatever GM version then click Invision free. Also replace the [ quote ] tag with [ CODEBOX ] and [ /quote ] with [ /CODEBOX ].
There you go! :GM6:

Edited by MP2:E, 25 November 2006 - 01:12 AM.

  • 0

#23 Fedor

Fedor

    GMC Member

  • New Member
  • 294 posts

Posted 25 November 2006 - 01:16 AM

<body>
<head>
tables
input feilds
HTML DOM
java_script
flash

<{POST_SNAPBACK}>

*Tables are possible if you make sprites
*Input feilds are possible(just make a box and then you can type in it)
*JavaScript, hm... you'll just have to make GM code when entered(but you can't do all of them)
*Flash.... You'll need a DLL on that :GM6:
Anyways Good Luck ^_^
  • 0

#24 Sandro

Sandro

    GMC Member

  • New Member
  • 184 posts

Posted 25 November 2006 - 03:52 AM

@MP2:E
Wow, i didn't know that. Anyway, I'm still going to keep it the way it is since I make a bit of money each time you guys view those ads.

@Fedor
I am very well aware that all of that is possible, having written scripts to do a lot of that myself, but I don't want to add them to the HTML script for 2 reasons
- Too much work
- The script is slow enough as it is, Tables and Input fields will slow it down even more.

and as for flash and java_script, way, way too much work.

this wasn't ment to convert the entire HTML, just enough too make the draw_text function more powerful. And that it dose. And I very proud of that. Just a few more tags and a way too speed it up, and it's done.
  • 0

#25 Sandro

Sandro

    GMC Member

  • New Member
  • 184 posts

Posted 28 November 2006 - 03:00 AM

- Sorry there haven't been any updates in a while, I got caught up on other things.
- I fixed the speed problem, tho I wouldn't make really big text, since the draw_html() isn't any faster. If your text is too big it might freeze the game.
- I have a draw_html() version 1.3 out as soon as I can.
  • 0

#26 Sandro

Sandro

    GMC Member

  • New Member
  • 184 posts

Posted 21 April 2007 - 06:13 PM

new draw_html() version 1.3, enjoy:

Yes i know it's been a while but i have been doing a lot of other work.
  • 0

#27 TheGameMaker

TheGameMaker

    the game maker

  • GMC Member
  • 296 posts
  • Version:Unknown

Posted 21 April 2007 - 06:39 PM

Wow! This is amazing! And very useful! Great job!
  • 0

tgmsig.png


#28 a2h

a2h

    GMC Member

  • New Member
  • 382 posts

Posted 22 April 2007 - 12:10 PM

<script> - Adds GML code

<sm> - draws a smiliey face

<font_name>Times New Roman</font_name>
<font_size>10</font_size>
<font_color>red</font_color>

<symbol-,> - adds a '<' symbol
<symbol-.> - adds a '>' symbol
<symbol-c> - adds a '©' symbol
<symbol-r> - adds a '®' symbol
<symbol-tm> - adds a '™' symbol


You should have <font face="font name">yada yada yada</font> for font, for <symbol-,> you should have &lt; and for the one that displays > you should have &gt;

For copyright it is &copy;
For registered it is &reg;
For trademark it is &trade;

Back to the fonts...
<font_size>10</font_size>
<font_color>red</font_color>

Replace those with
<font size="10">yada yada yada</font>
<font color="red">yada yada yada</font>

For more realism you could have <script type="text/gml"> instead of just <script>

Edited by rctxtreme, 22 April 2007 - 12:14 PM.

  • 0

ion.developments does not exist, ignore my user title

#29 Sandro

Sandro

    GMC Member

  • New Member
  • 184 posts

Posted 22 April 2007 - 05:30 PM

For those of you who are reading this, I'm working on HTML to GML ver 2.0; witch will be a GM7 extension.

the <script> tag is being removed due to it's lack in use (In GM5 you were able to change the font and stuff)

The Remaining engine is being rewritten to allow for <font_align> and to align the fonts at the bottom(If you unsure what that means, nm ^_^ )

Thank you rctxtreme, I will take the symbols into version 2.0 and remove the <symbol-> tags. I want this to follow HTML as much as possible.

As far as the <font> tags err well I know, but I didn't want to deal with attributes(too much string handling crap) but I will take that into consideration.

PLUS: I also plan to links and Animated Smilies
  • 0