Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

QD

a geometric graphics package inspired by QBasic graphics

Methods:

  • screen (int width, int height) : set screen size
  • pset (int x, int y, rgb color) : set the color a pixel
  • pget (int x, int y) : get the color of a pixel
  • line (int x1, int y1, int x2, int y2) : draw a line
  • cls () : clear the screen
  • cls (rgb color) : set the whole screen to that color
  • events (keyPressedDg = null, mouseEventDg = null, quitDg = null) : set up event callbacks. These take over the current thread.
  • flip () : update the screen. By default, a hidden buffer is updated; flip displays the contents of that buffer.

Event records:

  • key[char].pressed : returns true if the given key was pressed
  • mouse.pressed (Button button) : returns true if the given button was pressed. Similar events include clicked, released, and moved.