Glimmr Canvas-Based Drawing

version 2/101030 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next

  • Chapter - Converting image-map to screen coordinates

    [This phrase can only be used after the element scaling rules for the image-map have been followed.]

    To decide what list of numbers is the screen coordinate/coordinates/-- equivalent of (coord1 - a list of numbers) in the/-- internal/-- coordinates/-- of/-- (grid - an image-map) image-map/--:
        let dx be (entry 1 of coord1 - 1) * scaled tile-width of grid;
        let dy be (entry 2 of coord1 - 1) * scaled tile-height of grid;
        let x1 be (win-x of grid) + dx;
        let y1 be (win-y of grid) + dy;
        let L be a list of numbers;
        add x1 to L;
        add y1 to L;
        decide on L.