Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • #isVisible() & #isOnScreen() for tiles?


    deathizpro

    Recommended Posts

    Posted

    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.

    Posted

    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));
    }
    
    Posted

    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.

    Posted

     

    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.

    Posted

    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...

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.