SRL Archive - OSR Help

how do i draw text on rs?


g0tp0t

2010-04-11 01:28:22

i already know how to draw on rs so doont say it isnt possible. i just dont know how to draw text/write. anyone else know?

i wanna draw a proggy on rs2


anyone?

FEAR

2010-04-11 02:24:31

I think Timer(?) or someone made something like that for POMS essence miner. Send him a PM. Maybe he can teach you or better, ask him to make a tutorial so we can all learn :D

TRiLeZ

2010-04-11 02:27:26

Here's my function to write my script's progress report onto SMART's debug canvas:

procedure DebugProggy(TP: TStringArray; DC, Colour, Shadow: integer);
var
MX, MY, Pic, OldDC, I, B, H, TPH, Numb: Integer;
TTP: TPointArray;
begin
SmartSetDebug(True);
GetClientDimensions(mx,my);
Pic:= BitmapFromString(mx,my,'');
OldDC := GetTargetDC;
SetTargetDC(DC);
TPH := High(TP);
for I := 0 to TPH do
begin
TTP := LoadTextTPA(TP[i], FriendChars, H);
for B := 0 to High(TTP) do
begin
Numb := ((I + 1) * 13);
FastSetPixel(Pic, TTP[b].x + 10 + 1, TTP[b].y + 10 + Numb + 1, Shadow);
FastSetPixel(Pic, TTP[b].x + 10, TTP[b].y + 10 + Numb, Colour);
end;
end;
CopyCanvas(GetBitmapCanvas(Pic), GetClientCanvas, 0, 0, mx, my, 0, 0, mx, my);
FreeBitmap(Pic);
SetTargetDC(OldDC);
end;

To call it, use:

DebugProggy(["Test", "Test2"], SmartGetDebugDC, clWhite, 1644052);

MylesMadness

2010-04-11 19:10:59

Writeing on the real rs screen is pointless, but you could write on smarts debug canvas

g0tp0t

2010-04-11 20:51:11

i meant the smart canvas, lol, it would mostly be the same anyway. lol

================
debug proggy alone works, but this doesnt:

procedure DebugProggy(TP: TStringArray; DC, Colour, Shadow: integer);
var
MX, MY, Pic, OldDC, I, B, H, TPH, Numb: Integer;
TTP: TPointArray;
begin
SmartSetDebug(True);
GetClientDimensions(mx,my);
Pic:= BitmapFromString(mx,my,'');
OldDC := GetTargetDC;
SetTargetDC(DC);
TPH := High(TP);
for I := 0 to TPH do
begin
TTP := LoadTextTPA(TP[i], FriendChars, H);
for B := 0 to High(TTP) do
begin
Numb := ((I + 1) * 13);
FastSetPixel(Pic, TTP[b].x + 10 + 1, TTP[b].y + 10 + Numb + 1, Shadow);
FastSetPixel(Pic, TTP[b].x + 10, TTP[b].y + 10 + Numb, Colour);
end;
end;
CopyCanvas(GetBitmapCanvas(Pic), GetClientCanvas, 0, 0, mx, my, 0, 0, mx, my);
FreeBitmap(Pic);
SetTargetDC(OldDC);
end;

procedure dbg(stringtodraw: string; color, shadow: integer);
var i:integer;dbgstrings:tstringarray;
begin
{
for i:= 0 to GetArrayLength(dbgstrings)-2 do
if dbgstrings[i+1] <> nil then dbgstrings[i+1]:= dbgstrings[i];
dbgstrings[0] := stringtodraw;

debugproggy(dbgstrings,smartgetdebugdc,color,shadow); }
debugproggy(['hi','whats up'],smartgetdebugdc,color,shadow);
end;

i call like this:


dbg('Pick is Equipped' ,clblue, clblue-50);

g0tp0t

2010-04-15 07:27:38

anyone help?

ill un double post when someone answers, since edits dont show in new posts list

TRiLeZ

2010-04-17 18:41:41

clblue-50 isn't a color. Try using clBlack.

ZaSz

2010-04-17 19:59:06

Also, 'Pick is Equipped' isnt a String array.

Do dbg(['Pick is Equipped'],clblue, clBlack);

g0tp0t

2010-04-18 22:26:18

lol, neither were it, i have it fixed now and i dont know what changed, lol i forgot to add the brckets here but not in scar, and clblue IS a color, more specifically an integer representing a color so the - 50 was supposed to darken it, but i found +5 works better since +50 lightens it drasticly

Smartzkid

2010-04-19 00:29:43

Note that drawing onto SMART's debug canvas uses a lot of computational power.