topical media & game development

talk show tell print

#javascript-code-08-add.js / js



  // A function for adding a number of pixels to the horizontal
  // position of an element 
  function addX(elem,pos) {
      // Get the current horz. position and add the offset to it.
      setX( posX(elem) + pos );
  }
  
  // A function that can be used to add a number of pixels to the
  // vertical position of an element
  function addY(elem,pos) {
      // Get the current vertical position and add the offset to it
      setY( posY(elem) + pos );
  }
  
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.