Advertisement
Guest User

Untitled

a guest
Sep 20th, 2012
573
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Object is named "drawtext", no quotes. Script is called "drawtext_set".
  2.  
  3. //Create Event:
  4.  
  5. txt=''
  6. i=''
  7. p=0
  8. todraw=''
  9. pos=0
  10. secondarytext=''
  11.  
  12.  
  13. //Alarm 0:
  14.  
  15. if secondarytext=''{
  16.     todraw=''
  17.     txt=''
  18.     exit
  19.     }
  20. if secondarytext!=''{
  21.     script_execute(drawtext_set,secondarytext)
  22.     secondarytext=''
  23.     exit
  24.     }
  25.  
  26.  
  27. //Step Event:
  28.  
  29. if i!='.' and i!='!' and i!='?' and txt!=''{ //I did this the lazy way and had it check for punctuation.
  30. i=string_char_at(txt,pos)
  31. p=string_width(i)
  32. todraw=todraw+string(i)
  33. pos=pos+1
  34. sound_play(blip1)
  35. }
  36. if i='!' or i='.' or i='?'
  37.     if alarm[0]=-1{
  38.     if secondarytext='' alarm[0]=50
  39.     else alarm[0]=20
  40.     }
  41.  
  42.  
  43. //Draw Event:
  44.  
  45. draw_set_font(font3) //This is the font I wanted to use. I was too lazy to name it.
  46. draw_set_color(c_white) //Whatever color you want.
  47. execute code:
  48.  
  49. draw_set_halign(fa_left)
  50. draw_text(view_xview+10,view_yview+10,todraw)
  51. //Customize this a lot, until you are happy. This sets it to the top left corner.
  52. draw_set_halign(-1)
  53.  
  54. ____________________________________________
  55.  
  56. //Create Script named drawtext_set
  57.  
  58. drawtext.txt=argument0
  59. drawtext.pos=0
  60. drawtext.todraw=''
  61. drawtext.i=string_char_at(drawtext.txt,1)
  62. drawtext.alarm[0]=-1
  63.  
  64.  
  65. //Create Script named drawtext_set2
  66.  
  67. drawtext.txt=argument0
  68. drawtext.pos=0
  69. drawtext.todraw=''
  70. drawtext.i=string_char_at(drawtext.txt,1)
  71. drawtext.alarm[0]=-1
  72. drawtext.secondarytext=argument1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement