This resource is created for Game Maker 5 and isn't compatible with the latest version of Game Maker.
My apologies for the inconvinience.
My apologies for the inconvinience.
| Message box script |
//////////////// Message box script //////////////////// // // Copyright Simon Donkers 27-1-2005 // www.simondonkers.com - gmmentor@simondonkers.com // // argument0 is the text to draw // argument1 is the sprite of the speaker // argument2 is the color of the text // ///////////////////////////////////////////////////// string:= argument0; brush_color:= c_gray; //background color of the menu box font_color:= argument2; //text color font_size:= 18; //text size if sprite_get_height(argument1)<string_height_ext(argument0, -1, view_width[0]-sprite_get_width(argument1)-50) and string_height_ext(argument0,-1, view_width[0]-sprite_get_width(argument1)-50) < view_height[0]-40 then { height:= string_height_ext(argument0,-1, view_width[0]-sprite_get_width(argument1)-50); } if sprite_get_height(argument1) >string_height_ext(argument0, -1,view_width[0] - sprite_get_width(argument1) - 50) then { height:= sprite_get_height(argument1); } if string_height_ext(argument0,-1, view_width[0] - sprite_get_width(argument1) - 50) >view_height[0] -40 then { height:= view_height[0]-40; } while argument0!= '' { string:= argument0; //if message is smaller then the screen if string_height_ext(argument0, -1, view_width[0] - sprite_get_width(argument1) - 50) < view_height[0]-40 then { string:= argument0; argument0:= ''; } else { i:= string_length(argument0); while string_height_ext(string, -1, view_width[0] - sprite_get_width(argument1) - 50) > view_height[0]-40 { string:= string_copy(string,0,i-1); i-= 1; } while string_char_at(string,string_length(string))!= ' ' { string:= string_copy(string, 0, string_length(string) - 1); } argument0:= string_copy(argument0, string_length(string) + 1, string_length(argument0) - string_length(string)); } draw_rectangle(10, view_height[0] -30 -height, view_width[0]-10, view_height[0]- 10); draw_sprite(argument1,-1, 20,view_height[0] -20-height); font_align:= fa_left; draw_text_ext(sprite_get_width(argument1) + 30,view_height[0]- 20-height,string, -1,view_width[0]-sprite_get_width(argument1)-50); screen_refresh(); io_clear(); keyboard_wait(); } |
Tip: Have a look at the tutorial How to execute a script
User comments
| JakeX posted at 2005-06-18 02:44:57 | ![]() |
| buzzer posted at 2005-07-19 21:03:07 | ![]() |
| scronix posted at 2005-08-07 20:32:01 | ![]() |
| zigzag posted at 2005-10-23 17:06:35 | ![]() |
| Simon Donkers posted at 2005-10-23 20:54:04 | ![]() |
| Delta Entertainment Chairman posted at 2006-01-23 18:47:42 | ![]() |
| MyuuMaster (myuusmeow) posted at 2006-03-26 00:45:39 | ![]() |
| Megaspit posted at 2006-03-31 04:48:31 | ![]() |
| norlick posted at 2006-04-18 10:04:59 | ![]() |
| rockout posted at 2006-08-28 18:01:05 | ![]() |
| Music Matter posted at 2006-09-29 06:31:13 | ![]() |
| music matter posted at 2006-09-29 06:34:52 | ![]() |
| arylic singh posted at 2007-04-02 04:41:49 | ![]() |




How does it works? Can anyone help me? Sounds like a cool script.