【GAMEMAKER】Text Display

 Information about object: objTalk

Sprite: sprController
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
execute code:

ShowText=0;
for (i=0; i<15; i+=1) {
  line[i]="";
}

Keyboard Event for <any key> Key:
set variable ShowText to 0
Draw Event:
execute code:

if ShowText=0 then exit;

pen_color=c_black;
pen_size=5;
brush_color=c_blue;
font_name="Comic Sans MS";
font_color=c_red;
font_size=12;

sx=screen_width/4;
ex=sx*3;
sy=screen_height/4;
ey=sy*3;

draw_rectangle(sx,sy,ex,ey);
for (i=0; i<15; i+=1) {
  if line[i]!="" {
    draw_text(sx+5,sy+(i*15),line[i]);
  }
}
Information about object: objAddText
Sprite: sprController
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
execute code:

objTalk.line[0]="This is a test, line 0";
objTalk.line[1]="This is a test, line 1";
objTalk.line[2]="This is a test, line 2";
objTalk.line[3]="This is a test, line 3";
objTalk.line[4]="This is a test, line 4";
objTalk.line[5]="This is a test, line 5";
objTalk.line[6]="This is a test, line 6";
objTalk.line[7]="This is a test, line 7";
objTalk.line[8]="This is a test, line 8";
objTalk.line[9]="This is a test, line 9";
objTalk.line[10]="This is a test, line 10";
objTalk.line[11]="This is a test, line 11";
objTalk.line[12]="This is a test, line 12";
objTalk.line[13]="This is a test, line 13";
objTalk.line[14]="This is a test, line 14";
Mouse Event for Left Button:
execute code:

if objTalk.ShowText=0 {
  objTalk.ShowText=1;
} else {
  objTalk.ShowText=0;
}
io_clear();

No comments:

My New Favorite Music Genre Is Polish Noir

These 10 artists create music that is mystical, melancholy, magical, and more. ͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏    ...

Contact Form

Name

Email *

Message *