SRL Archive - SRL Suggestions

PaintSmart.scar


Shuttleu

2010-11-16 19:43:31

how about we have a SMART_DrawTextEx which also has the Clear parameter, it could be used to quickly and easily clear the canvas when someone starts their proggy

Current:
{*******************************************************************************
procedure SMART_DrawText(x, y: Integer; font, Text: string; Color: TColor);
Contributors: Jukka
Description: Draws a TBox onto the SMART Debug canvas
*******************************************************************************}
procedure SMART_DrawText(x, y: Integer; font, Text: string; Color:TColor);
var
i, height: integer;
tpa: tpointarray;
begin
tpa := LoadTextTPA(text,font,height);
for i:= 0 to high(tpa) do
begin
tpa[i].x := tpa[i].x + x;
tpa[i].y := tpa[i].y + y;
end;
SMART_DrawDotsEx(false, tpa, Color);
end;

My suggestion:
{*******************************************************************************
procedure SMART_DrawTextEx(Clear: Boolean; x, y: Integer; font, Text: string; Color: TColor);
Contributors: Jukka, Shuttleu
Description: Draws text onto the SMART Debug canvas at position x, y
*******************************************************************************}
procedure SMART_DrawTextEx(Clear: Boolean; x, y: Integer; font, Text: string; Color:TColor);
var
i, height: integer;
tpa: tpointarray;
begin
tpa := LoadTextTPA(text,font,height);
for i:= 0 to high(tpa) do
begin
tpa[i].x := tpa[i].x + x;
tpa[i].y := tpa[i].y + y;
end;
SMART_DrawDotsEx(Clear, tpa, Color);
end;

{*******************************************************************************
procedure SMART_DrawText(x, y: Integer; font, Text: string; Color: TColor);
Contributors: Shuttleu
Description: Draws text onto the SMART Debug canvas at position x, y
*******************************************************************************}
procedure SMART_DrawText(x, y: Integer; font, Text: string; Color:TColor);
begin
SMARTDrawTextEx(False, x, y, font, Text, Color);
end;

~shut

Gu3st...

2010-11-17 09:57:18

I agree with this.
Why not? DrawDotsEx has a clear parameter..

Also, just because I like to do stuff in a specific way, place Clear as the last parameter and X and Y first :)

Shuttleu

2010-11-17 16:15:50

well the reason why i put it first is because that's the way its done with the others

~shut

Coh3n

2010-11-17 17:52:16

Why is this in the Reflection section? Also, you may want to update the descriptions. :p

Shuttleu

2010-11-17 18:00:51

From: Coh3n
Why is this in the Reflection section? Also, you may want to update the descriptions. :p


i didnt mean to put it in reflection :s
the description is what it is in the actual files

~shut

Coh3n

2010-11-17 18:02:16

From: Shuttleu
i didnt mean to put it in reflection :s
the description is what it is in the actual files

~shut

I'll move it, and they still need to be updated, whether you wrote them, or someone else. :p

Shuttleu

2010-11-17 18:05:41

From: Coh3n
I'll move it, and they still need to be updated, whether you wrote them, or someone else. :p


i already had :)

~shut

Coh3n

2010-11-17 18:17:11

Beauty. Tested and committed. :) Thanks.