MouseClick

An input bean that marks its subgraph as sensitive to mouse clicks.

Features

XML Element XML Type Java Class
input mouseClick uk.ac.ic.doc.scenebeans.MouseClick

Properties

Name Type Default Value Getter Method Setter Method Description
pressedEvent String "pressed" getPressedEvent getPressedEvent The name of the AnimationEvent announced when the user presses a mouse button over some part of the bean's subgraph.
releasedEvent String "released" getReleasedEvent getReleasedEvent The name of the AnimationEvent announced when the user releases a mouse button over some part of the bean's subgraph.

Example XML

<animation width="64" height="64">
  <draw>
    <input type="mouseClick" id="click">
      <param name="pressedEvent" value="pressed"/>
      <param name="releasedEvent" value="released"/>
      
      <style type="RGBAColor">
        <param name="color" value="ff0000"/>
        <primitive type="rectangle">
          <param name="x" value="2"/>
          <param name="y" value="2"/>
          <param name="width" value="60"/>
          <param name="height" value="60"/>
        </primitive>
      </style>
    </input>
  </draw>
  
  <event object="click" event="pressed">
    <announce event="pressed"/>
  </event>
  
  <event object="click" event="released">
    <announce event="released"/>
  </event>
</animation>