Package framework.component.util

Examples of framework.component.util.MouseFollowerComponent


    cursorParent.addComponent(collis);

    setUpEventListener(collis);

    cursorParent.addComponent(new PositionComponent(50,50));
    cursorParent.addComponent(new MouseFollowerComponent());
    return cursorParent;
  }
View Full Code Here


    p1.addComponent(new PositionComponent(100,100));
    SpriteComponent s1 = new SpriteComponent("res/img/square.png", new Vector2f(-25, -25), 50, 50);
    s1.setAlwaysOnTop();
    p1.addComponent(s1);
   
    p1.addComponent(new MouseFollowerComponent());
    p1.addComponent(new CollisionComponent(new CircularCollisionMask(25)));
    p1.addComponent(new OrientationComponent(-100));
    final SpinComponent spin = new SpinComponent(0.1f);
    //p1.addComponent(spin);
    EventSystem.getInstance().registerEventListener(new EventListener() {
View Full Code Here

    gridLine.addComponent(new CollisionComponent(new LineCollisionMask(new Line(0, 0, 0, 100))));
    //gridLine.addComponent(new CollisionComponent(new RectangularCollisionMask(new Rectangle(10, 50))));
   
    ParentComponent cursor = new ParentComponent();
    root.addComponent(cursor);
    cursor.addComponent(new MouseFollowerComponent());
    cursor.addComponent(new PositionComponent(0,0));
    cursor.addComponent(new SpriteComponent("res/img/dot.png",new Vector2f(-5,-5),10,10));
    //cursor.addComponent(new CollisionComponent(new PointCollisionMask()));
    cursor.addComponent(new CollisionComponent(new CircularCollisionMask(5)));
    //cursor.addComponent(new CollisionComponent(new RectangularCollisionMask(new Rectangle(10, 10), new Vector2f(-5, -5))));
View Full Code Here

            setHasBeenPlaced(true);
          }
        }
      }else if(e.getType().equals("CollisionStarted")){
        CollisionStartedEvent c = (CollisionStartedEvent) e;
        MouseFollowerComponent mouse = (MouseFollowerComponent) c.getCollidedWith().getSiblingByType(MouseFollowerComponent.class.getName());
        if(mouse != null){
          setMouseInside(true);
        }
      }else if(e.getType().equals("CollisionStopped")){
        CollisionStoppedEvent c = (CollisionStoppedEvent) e;
        MouseFollowerComponent mouse = (MouseFollowerComponent) c.getCollidedWith().getSiblingByType(MouseFollowerComponent.class.getName());
        if(mouse != null){
          setMouseInside(false);
        }
      }
    }
View Full Code Here

TOP

Related Classes of framework.component.util.MouseFollowerComponent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.