deathizpro 12 Posted July 26, 2016 I'm looking for a way to walk until a new tile is visible, is there a way to do so for tiles and/or areas? isOnScreen() is only available for entities. Something like ViewportTools#isOnMainScreen and ViewportTools#isOnGameScreen would be good for them but (guessing) they deal with physical screen bounds bc they only take java.awt.
Calculus 30 Posted July 26, 2016 I'm looking for a way to walk until a new tile is visible, is there a way to do so for tiles and/or areas? isOnScreen() is only available for entities. Something like ViewportTools#isOnMainScreen and ViewportTools#isOnGameScreen would be good for them but (guessing) they deal with physical screen bounds bc they only take java.awt. I think you answered your own question here... public boolean isTileOnScreen(Tile t){ return getClient().getViewport().isOnGameScreen(getMap().tileToScreen(t)); }
Dreamlicker 750 Posted July 26, 2016 getMap().isTileOnScreen(Tile tile) && getMap().isVisible(Tile tile)
Calculus 30 Posted July 26, 2016 getMap().isTileOnScreen(Tile tile) && getMap().isVisible(Tile tile) Returns false if the tile isn't completely on screen. My method returns true if any portion of the tile is on screen.
deathizpro 12 Author Posted July 26, 2016 I think you answered your own question here... public boolean isTileOnScreen(Tile t){ return getClient().getViewport().isOnGameScreen(getMap().tileToScreen(t)); } Wasn't using the getMap.tileToScreen(t), that's prob why. Thanks.
Calculus 30 Posted July 26, 2016 Wasn't using the getMap.tileToScreen(t), that's prob why. Thanks. Apparently DB's method for tileToScreen is broken now...always returns a point (-1, -1) for some reason. Use dream's for now...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.