WebFund 2013F: Tutorial 8

From Soma-notes
Revision as of 21:38, 23 October 2013 by Soma (talk | contribs) (Created page with "'''This tutorial is not yet finalized''' To add a quit button: * Add the button to the page in <tt>index.html</tt> (make it the letter Q) similar to the information and sound...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This tutorial is not yet finalized

To add a quit button:

  • Add the button to the page in index.html (make it the letter Q) similar to the information and sound buttons.
  • Style the button in a fashion similar to the info button in letterscript.css (look for the #infos attributes). Note you will have to change the offset; otherwise the button will overlap with the sound button.
  • In letterpaint.js:
    • Add a quitbutton variable similar to the one for sound or info.
    • Add an event listener for the quit button, referring to a quit() callback function.
    • Define quit(), having it set the value of window.location to be the URL you wish to visit when you quit ("/").