Pages: 1
Author Topic: A Pop up Message script  (Read 2462 times)
Offline (Male) hpg678
Posted on: September 25, 2017, 12:37:24 pm

Location: Barbados
Joined: Mar 2017
Posts: 283

View Profile Email
the objective of this project is to create a message box calling a script named "scr_show_message()". The idea is to place any text in between the () and it will be displayed.

the code in the script is this

Code: [Select]
var message;
message=argument0; // use '#' to write text on a new line

var bg;
bg=spr_message_bg; //sprite used as a background

var box_x, box_y, box_height, box_width;
box_x= (room_width/2) - (box_width/2);
box_y= (room_height/2) - (box_height/2);

draw_sprite_ext(bg,0, box_x, box_y, box_width/32, box_height/32, 0, -1, 1)
draw_text(box_x+5, box_y+5, message);

when you call it from the DRAW event you should be able to see a pop-up message the length and height according to the text you place in ().
« Last Edit: September 25, 2017, 12:41:00 pm by hpg678 » Logged
[compromised account]
Pages: 1