masquerader
2006-11-12 01:41:42
Seeing as the current methods of getting the uptext are spotty at best, and scripters have to resort to things like isuptextmulti, i figured i would try to come up with something new
this here is my second try :tongue:
the first one only used shadows and sucked
anyway, it takes the uptext colors in tpoint arrays, plots them on a bitmap, and then uses that for text stuff
ive had some success with it
the hard part is the colors and tolerances, so it will either be 100% or nothing
i made a debug window, so its easy to see if they work
just push play, then move your mouse over something within 3 sec
i guess what i really need is for people to see if they can come up with any better colors for the uptexts
it seemed like every couple minutes, the colors would completely change and break everything :(
this here is my second try :tongue:
the first one only used shadows and sucked
anyway, it takes the uptext colors in tpoint arrays, plots them on a bitmap, and then uses that for text stuff
ive had some success with it
the hard part is the colors and tolerances, so it will either be 100% or nothing
i made a debug window, so its easy to see if they work
just push play, then move your mouse over something within 3 sec
i guess what i really need is for people to see if they can come up with any better colors for the uptexts
it seemed like every couple minutes, the colors would completely change and break everything :(
program UpText;
//masquerader
var
textbmp,i,t:integer;
orangepoints,whitepoints,bluepoints,yellowpoints:tpointarray;
debugcanvas:tcanvas;
upchars,handle:integer;
begin
UpChars:=LoadChars2(AppPath + 'includes\SRL\UpChars\');
wait(3000);
t:=getsystemtime;
textbmp:=bitmapfromstring(500,17,'');
fastdrawclear(textbmp,0);
//white
findcolorstolerance(whitepoints,13624288,7,7,507,23,43);
//orange
findcolorstolerance(orangepoints,3705570,7,7,507,23,35);
//blue
findcolorstolerance(bluepoints,13224197,7,7,507,23,60);
//yellow
findcolorstolerance(yellowpoints,711645,7,7,507,23,50);
for i:=0 to getarraylength(whitepoints)-1 do
fastsetpixel(textbmp,whitepoints[i].x-7,whitepoints[i].y-7,16777215);
for i:=0 to getarraylength(orangepoints)-1 do
fastsetpixel(textbmp,orangepoints[i].x-7,orangepoints[i].y-7,16777215);
for i:=0 to getarraylength(bluepoints)-1 do
fastsetpixel(textbmp,bluepoints[i].x-7,bluepoints[i].y-7,16777215)
for i:=0 to getarraylength(yellowpoints)-1 do
fastsetpixel(textbmp,yellowpoints[i].x-7,yellowpoints[i].y-7,16777215)
displaydebugimgwindow(500,17);
debugcanvas:=getdebugcanvas;
copycanvas(getbitmapcanvas(textbmp),debugcanvas,0,0,500,17,0,0,500,17);
handle:=getclientwindowhandle;
settargetbitmap(textbmp);
writeln(gettextatex(0,0,0,upchars,false,false,0,2,16777215,60,false,tr_normalchars));
setclientwindowhandle(handle);
writeln(inttostr(getsystemtime-t)+' ms');
end.