Skip to content

Commit 5f6933e

Browse files
authored
Merge pull request #114 from jacz24/patch-3
Changed TRSObject to TRSEntityArray for TRSEntityArray documentation
2 parents a96e822 + f8ca1d5 commit 5f6933e

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

osrs/position/map/entities.simba

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,10 @@ Example:
177177
{$I WaspLib/osrs.simba}
178178

179179
var
180-
objs: TRSObjectArray;
180+
entities: TRSEntityArray;
181181
begin
182182
Map.Setup([ERSChunk.VARROCK]);
183-
objs := TRSObject.Create(ObjectsJSON.GetByName('bank'));
183+
entities := TRSEntityArray.Create(NPCsJSON.GetByName('Banker'));
184184
end;
185185
```
186186
*)
@@ -853,6 +853,13 @@ begin
853853
Self.DrawTPA(boundsArray[i].Connect());
854854
end;
855855

856+
(*
857+
## ShowOnTarget TRSEntity
858+
```pascal
859+
procedure ShowOnTarget(entity: TRSEntity); overload;
860+
```
861+
Shows an image of the target with the `TRSEntity` drawn on it.
862+
*)
856863
procedure ShowOnTarget(entity: TRSEntity); overload;
857864
var
858865
img: TImage;
@@ -862,6 +869,25 @@ begin
862869
img.Show();
863870
end;
864871

872+
(*
873+
## ShowOnTarget TRSEntityArray
874+
```pascal
875+
procedure ShowOnTarget(entities: TRSEntityArray); overload;
876+
```
877+
Shows an image of the target with the `TRSEntityArray` drawn on it.
878+
*)
879+
880+
procedure ShowOnTarget(entities: TRSEntityArray); overload;
881+
var
882+
img: TImage;
883+
i: Integer;
884+
begin
885+
img := Target.GetImage();
886+
for i := 0 to High(entities) do
887+
img.DrawEntity(entities[i]);
888+
img.Show();
889+
end;
890+
865891

866892
function ToString(constref entity: TRSEntity): String; override;
867893
begin

0 commit comments

Comments
 (0)