Graphic Links

version 2 by Jeff Sheets

  • Home page
  • Beginning
  • Previous
  • Next



  • Part 2 - Basic Input

    The last when play begins rule:
        start looking for graphlinks.

    To start looking for graphlinks:
        (- SetGraphLink(); -)
        
    A glulx mouse input rule (this is the default graphlink setting rule):
        perform glulx graphlink request.

    To perform glulx graphlink request:
        (- if (glk_gestalt(gestalt_MouseInput, winType_Graphics)) DoGraphLink(); -)

    To cancel input in main window:
        (- glk_cancel_line_event(gg_mainwin, GLK_NULL); glk_cancel_char_event(gg_mainwin); -)

    Include (-
    [ DoGraphLink;
        SetGraphLink();
        playGraphlink(gg_event-->2, gg_event-->3);
    ];

    [ playGraphlink x y;
        (+ current graphlink x +) = x;
        (+ current graphlink y +) = y;
        FollowRulebook( (+ clicking graphlink rules +) );
    ];

    [ SetGraphLink ;
        if (gg_picwin) {
         if (glk_gestalt(gestalt_MouseInput, winType_Graphics)) glk_request_mouse_event(gg_picwin);
        }
    ];

    -)