Image element (used with Interface module)

Description:

This element adds an image to an interface. This is a very simple element, and it only has one method associated with it!

To use:

The code for this element is included in the interface module, linked as follows:

<script language="Javascript" src="gamelib_interface.js"></script>

It's very easy to use this element; you just place it in the interface like so:

  myImage=new In_Image(3,62,150,86,'../images/face0.gif');
  myInterface.add(myImage);

The five parameters passed to this object are x,y position, width and height, then finally the URL for the image itself. Simple eh? :-)

List of methods for Image

setImage

Descriptions of methods for Image

MethodParametersDescription
setImageURL Change the image source to a new image. The new image will occupy the same space as the original, so if you source an image of a different size, it will be scaled to fit.