1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

Mac OSX I NEED HELP PLEASE

Discussion in 'Programming' started by yonis, Jul 29, 2019.

  1. yonis

    yonis Member

    Joined:
    Jul 29, 2019
    Posts:
    1
    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]
     
  2. curato

    curato Member

    Joined:
    Jun 30, 2016
    Posts:
    424
    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 
     
  3. Ouroboros

    Ouroboros Member

    Joined:
    Jul 23, 2016
    Posts:
    12
    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]
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice