SRL Archive - Unofficial Development

Important reflection functions..?


Fitta

2014-08-23 14:54:07

r_TileOnMS


function r_TileOnMS(tile: TPoint): Boolean;
begin
Result := (PointInBox(r_TileToMS(tile), IntToBox(MSX1, MSY1, MSX2, MSY2)));
end;


adding more as it comes along..

Kyle

2014-08-23 16:27:15

EDIT:Nvm, missread the function

ineedbot

2014-08-23 17:15:06

From: Fitta
r_TileOnMS


function r_TileOnMS(tile: TPoint): Boolean;
begin
Result := (PointInBox(tile, IntToBox(MSX1, MSY1, MSX2, MSY2)));
end;


adding more as it comes along..

The function in it's current state isn't going to do much. It's only going to see if the TPoint argument is within the boundaries of the main screen's box. You would need to convert the RSTile to a point on the main screen with a function like R_TileToMS.
function R_RSTileOnMS(tile:TRSTile):boolean;
begin
result := PointInBox(R_RSTileToMS(tile), MSBox);
end;

Just to note, I personally like to keep TPoints and RSTiles separate so the conversation is obvious.