Results 1 to 3 of 3

Thread: TReflectionTiles.TileOnScreen

  1. #1
    Join Date
    Mar 2015
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default TReflectionTiles.TileOnMS

    Code:
    function TReflectionTiles.TileOnMS(Tile: TTile): Boolean;
    var
      MS: TPoint;
    begin
      MS := TReflectionInternals.TileToMS(Tile.X, Tile.Y, 0);
      Result := (MS.X > MSX1) and (MS.X < MSX2) and
                (MS.Y > MSY1) and (MS.Y < MSY2);
    end;
    I use this to determine whether I can click on the tile or I have to turn the camera to the tile (or use the minimap.)
    Last edited by flamingo1; 03-13-2015 at 12:32 AM.

  2. #2
    Join Date
    Feb 2013
    Location
    Rimmington
    Posts
    319
    Mentioned
    33 Post(s)
    Quoted
    183 Post(s)

    Default

    Simba Code:
    function TileOnMS(Tile: TPoint): Boolean;
    begin
      Result := PointInBox(Reflect.Tiles.TileToMS(Tile), intToBox(MSX1, MSY1, MSX2, MSY2));
    end;






  3. #3
    Join Date
    Mar 2015
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Fitta View Post

    Much simpler than mine, thanks for this!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •