Jump to content

[sinppet] entity debugger


Recommended Posts

Posted (edited)

i was not really sure what to call it, but here the method i use for Divine utility. Method returns a position under your mouse.

	public Position findUnderMouse() {
		if (getMouse().isWithinCanvas()) {
			Area area = myPlayer().getArea(25);
			area.setPlane(getMap().getPlane());
			
			for (Position pos: area.getPositions()) {
				if(pos.isVisible(getBot()) && pos.getPolygon(getBot()).contains(mouse.getPosition())) {
					return pos;
				}
			}
		}
		return null;
	}
Edited by jos3dpay
  • Like 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...