up Inquisit Language Reference

containsPoint function

Returns true if the visual stimulus contains the given point on the screen.

Member of

<button><clearScreen><clock><html><picture><shape><text><video>

Syntax

visualstimulus.name.containsPoint(x, y)

Return Type

boolean

Parameters

Name Type Description
x extent The horizontal screen coordinate.
y extent The vertical screen coordinate.

Remarks

Examples

This trial checks at the end whether the mouse response coordinates for a 'left down mouse click' happened to be on the 'leftBox', the 'rightBox' or 'somewhere else'.

<trial move>
/ inputDevice = mouse
/ stimulusFrames = [1 = leftBox, rightBox]
/ validResponse = (mouseMove, lButtonDown)
/ onTrialEnd = {
  values.resp = this.response;
  if (this.response == mouse.lButtonUp){
    if (shape.leftBox.containsPoint(mouse.x, mouse.y)){
      values.resp = "left";
    } else if (shape.rightBox.containsPoint(mouse.x, mouse.y)){
      values.resp = "right";
    } else {
      values.resp = "somewhere else";
    }
  }
}
/ branch = {
  if (values.resp == "mouseMove"){
    return this;
  }
  return null;
}
</trial>

Copyright Millisecond Software, LLC. All rights reserved.