# Glimmr Graphic Hyperlinks

## version 1/100805 by Erik Temple

**Part 3b - Clicking Graphlink Rules II (for use with Glimmr Canvas-Based Drawing by Erik Temple)**

Current graphlink is an object that varies. [The current graphlink is either text or g-element, depending on whether Glimmr Canvas-Based Drawing is also in use]

A clicking graphlink rule (this is the default command replacement by graphlinks rule):

if the click hit a hot link:

#if utilizing Glimmr debugging;

let graph-x be current graphlink x as a fixed point number;

let graph-y be current graphlink y as a fixed point number;

say "[>console][GGH]Mouse input received on element [i][current graphlink][/i] in window [i][current graphlink window][/i]: ([current graphlink x], [current graphlink y]), approximately equivalent to canvas ([(graph-x real minus the x-offset of the current graphlink window) real divided by the scaling factor of the current graphlink window as an integer], [(graph-y real minus the y-offset of the current graphlink window) real divided by the scaling factor of the current graphlink window as an integer]).[<]";

#end if;

follow the graphlink processing rules for the current graphlink;

rule succeeds;

otherwise:

#if utilizing Glimmr debugging;

let graph-x be current graphlink x as a fixed point number;

let graph-y be current graphlink y as a fixed point number;

say "[>console][GGH]Mouse input received in window [i][current graphlink window][/i] (no link triggered): ([current graphlink x], [current graphlink y]), approximately equivalent to canvas ([(graph-x real minus the x-offset of the current graphlink window) real divided by the scaling factor of the current graphlink window as an integer], [(graph-y real minus the y-offset of the current graphlink window) real divided by the scaling factor of the current graphlink window as an integer]).[<]";

#end if;

now glulx replacement command is "".

The default command replacement by graphlinks rule is listed last in the clicking graphlink rules.