Class JigsawPuzzle.Target

java.lang.Object
com.badlogic.gdx.scenes.scene2d.utils.DragAndDrop.Target
net.dermetfan.gdx.scenes.scene2d.ui.JigsawPuzzle.Target
Enclosing class:
JigsawPuzzle

public class JigsawPuzzle.Target extends com.badlogic.gdx.scenes.scene2d.utils.DragAndDrop.Target
Since:
0.10.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    Target(com.badlogic.gdx.scenes.scene2d.Group group, float tolerance)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    drag(com.badlogic.gdx.scenes.scene2d.utils.DragAndDrop.Source source, com.badlogic.gdx.scenes.scene2d.utils.DragAndDrop.Payload payload, float x, float y, int pointer)
     
    void
    drop(com.badlogic.gdx.scenes.scene2d.utils.DragAndDrop.Source source, com.badlogic.gdx.scenes.scene2d.utils.DragAndDrop.Payload payload, float x, float y, int pointer)
     
     
    float
     
    protected void
    called by drop when a piece is placed
    void
    setTolerance(float tolerance)
     

    Methods inherited from class com.badlogic.gdx.scenes.scene2d.utils.DragAndDrop.Target

    getActor, reset

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Target

      public Target(com.badlogic.gdx.scenes.scene2d.Group group, float tolerance)
      Parameters:
      tolerance - the tolerance
  • Method Details

    • drag

      public boolean drag(com.badlogic.gdx.scenes.scene2d.utils.DragAndDrop.Source source, com.badlogic.gdx.scenes.scene2d.utils.DragAndDrop.Payload payload, float x, float y, int pointer)
      Specified by:
      drag in class com.badlogic.gdx.scenes.scene2d.utils.DragAndDrop.Target
    • drop

      public void drop(com.badlogic.gdx.scenes.scene2d.utils.DragAndDrop.Source source, com.badlogic.gdx.scenes.scene2d.utils.DragAndDrop.Payload payload, float x, float y, int pointer)
      Specified by:
      drop in class com.badlogic.gdx.scenes.scene2d.utils.DragAndDrop.Target
    • placed

      protected void placed(JigsawPuzzle.Piece piece)
      called by drop when a piece is placed
      Parameters:
      piece - the placed piece
    • getPuzzle

      public JigsawPuzzle getPuzzle()
      Returns:
      the enclosing JigsawPuzzle instance
    • getTolerance

      public float getTolerance()
      Returns:
      the tolerance
    • setTolerance

      public void setTolerance(float tolerance)
      Parameters:
      tolerance - the tolerance to set