SRL Archive - SRL Archives

BankBox in Bank.scar


Raskolnikov

2008-03-11 17:59:13

Hi,

I don't see a bankbox in bank.scar anymore so here is my function, it also has an option to fix the bank:

(*************************************************************
(Author: Cut em2 it
(Purpose: Make a TBox of a bank index
*************************************************************)
function BankBox(BankIndex: integer; FixTheBank: boolean): TBox;
begin
if FixTheBank then FixBank;
if BankIndex div 8 > 5 then Exit;
Result.x1 := 79 * (BankIndex div 5);
Result.y1 := 62 * (BankIndex div 8);
Result.x2 := 118 * (BankIndex div 5);
Result.y2 := 96 * (BankIndex div 8);
end;

Thanks,
Cut em2 it

Wizzup?

2008-03-11 18:23:29

Hello Cut em2 it,

{*******************************************************************************
Function BankIndexToMSBox(Ind: Integer): TBox;
by: Wizzup?
Description: Converts a BankIndex to a MainScreen TBox of the slot.
*******************************************************************************}

Function BankIndexToMSBox(Ind: Integer): TBox;

Var
P: TPoint;

Begin
P := BankIndexToBankPoint(Ind);
Result.X1 := 75 + P.X * 47;
Result.Y1 := 60 + P.Y * 38;
Result.X2 := Result.X1 + 42;
Result.Y2 := Result.Y1 + 36;
End;

Is this the function that you are referring to? I rewrote all those BankBox functions a few revisions ago… I think somewhere in SRL #11.

Raskolnikov

2008-03-11 18:47:47

Ah, yes, I think that is the one. Thanks for clearing that up :D

Cut em2 it