Mac OSX I NEED HELP PLEASE

yonis

Member
i am new to game maker and i copied a youtube video about adding dialogue and text boxes but it keeps saying error. I dont know what it means or what to do.
my code:
//scr_text("Text",speed,x,y); txt = instance_create(argument2,argument3,obj_text); with (txt){ padding = 16; maxlength = view_wview[0]; text = argument0; spd = argument1; font = fnt; text_length = string_length(text); font_size = font_get_size(font); draw_set_font(font); text_width = string_width_ext(text, font_size+(font_size/2), maxlength); text_height = string_height_ext(text, font_size+(font_size/2), maxlength); boxwidth = text_width + (padding*2); boxheight = text_height + (padding*2); }; //END scr_text SCRIPT

error are:txt = instance_create(argument2,argument3,obj_text);

[FONT=Roboto, Arial, sans-serif]and:maxlength = view_wview[0];[/FONT]
 

curato

Member
What error are you getting exactly? Also do not put all your code on one line it will confuse the crap out of you. Also, when you care code your the code brackets from under insert it will keep your formatting.
The only thing jumping out at me is the ; after the } at the end of your code.
For reference
Code:
//scr_text("Text",speed,x,y);
txt = instance_create(argument2,argument3,obj_text);
with (txt)
{
    padding = 16;
    maxlength = view_wview[0];
    text = argument0;
    spd = argument1;
    font = fnt;
    text_length = string_length(text);
    font_size = font_get_size(font);
    draw_set_font(font);
    text_width = string_width_ext(text, font_size+(font_size/2), maxlength);
    text_height = string_height_ext(text, font_size+(font_size/2), maxlength);
    boxwidth = text_width + (padding*2);
    boxheight = text_height + (padding*2);
} //END scr_text SCRIPT
 

Ouroboros

Member
use "
Code:
 your code
" to post code here.

If you use gamemaker studio 2, use
Code:
instance_create_depth(x, y, depth, object)
instead instance_create and
Code:
camera_get_view_width(view_camera[0])
instead view_wview[0]
 
Top