PDA

View Full Version : uptext



Olly
03-04-2013, 04:51 PM
OCR has a mind of its own, seems to work perfectly today, add this into text.simba(?) and call setupOSRFilter in and load2007Fonts in setupSRL and getUptext should work, if you find any bugs please post.

Font is included in the attachments, rename to "07UpChars" and create a folder in Fonts named as 2007Fonts and place in there. you need the newest 993 simba build for this.


const
fontPath_07 = fontPath + '2007Fonts\';

const
ocr_Limit_High = 190;
ocr_Limit_Med = 130;
ocr_Limit_Low = 65;

ocr_White = 16777215;
ocr_Yellow = 65535;
ocr_Blue = 16776960;
ocr_Purple = 8388736;

const
OF_LN = 256;
OF_HN = -1;

function TOCRStruct(r_low,r_high,g_low,g_high,b_low,b_high, set_col: integer; is_text_color: boolean): tocrfilterdata;
begin
result.r_low := r_low;
result.r_high := r_high;
result.g_low := g_low;
result.g_high := g_high;
result.b_low := b_low;
result.b_high := b_high;
result.set_col := set_col;
result._type := 0;
result.is_text_color:= is_text_color;
end;

//to-do: add level filters, filter any futher bugs
procedure setupOSRFilter;
var
filterdata: TOCRFilterDataArray;
begin
setlength(filterdata, 3);

filterdata[0] := TOCRStruct(65, OF_HN, OF_LN, 190, OF_LN, 190, ocr_Blue, True); // blue
filterdata[1] := TOCRStruct(OF_LN, 190, OF_LN, 190, 65, OF_HN, ocr_Yellow, True); // yellow
filterdata[2] := TOCRStruct(65, OF_HN, 65, OF_HN, 65, OF_HN, ocr_Purple, False); // shadow

rs_ResetUpTextFilter;
rs_SetUpTextFilter(filterdata);
end;

procedure load2007Fonts;
var
fontNames: tstringarray;
i: integer;
begin
fontNames := ['07UpChars'];

for i := 0 to high(fontNames) do
if loadFont(fontPath_07 + fontNames[i], true) then
loadFont(fontPath_07 + fontNames[i], false);

end;

Replace the old getUpText with this (in text.simba)
function getUpText: string;
begin
result := rs_GetUpTextAtEx(5, 5, true, '07UpChars');
end;




Attack Man / 4 more options
Attack Man / 4 more options
Attack Man / 4 more options
Walk here
Walk here / 1 more options
Walk here / 1 more options
Climb-down Trapdoor / 2 more options
Walk here
Talk-to Gee / 2 more options
Talk-to Gee / 2 more options
Walk here
Talk-to Cook / 2 more options
Talk-to Cook / 2 more options

Ashaman88
03-04-2013, 05:04 PM
Those them results is b e a utiful.


Any idea when 993 will be official version?

Olly
03-04-2013, 05:06 PM
Those them results is b e a utiful.

Any idea when 993 will be official version?

No clue, that's one for Wizzup :).

Hobbit
03-04-2013, 05:37 PM
Good work Ollybest; :)

Olly
03-04-2013, 08:51 PM
updated since to use a font in a certain folder and use getuptextex :)

Wizzup?
03-04-2013, 09:44 PM
Simba here, will also be in 993: http://villavu.com/forum/showthread.php?t=97774&p=1186483#post1186483

Make sure to update to the latest 993 until I officially release it.

Justin
03-06-2013, 06:35 AM
Was going to do some uptext testing, getting this error
http://puu.sh/2cVmK

At the bottom of Simba, you can see the function is missing 'fontname: string'
Running the Simba that Wizzup? posted ^^


Downloaded build 1000 (most recent build - (52) http://nala.villavu.com/downloads/simba-prev/d3eda87a0938f35ce9b8291138520d7480c2f3a6/ )
Compiled fine.

http://puu.sh/2cVsx

Wizzup?
03-06-2013, 09:30 AM
Was going to do some uptext testing, getting this error
http://puu.sh/2cVmK

At the bottom of Simba, you can see the function is missing 'fontname: string'
Running the Simba that Wizzup? posted ^^


Downloaded build 1000 (most recent build - (52) http://nala.villavu.com/downloads/simba-prev/d3eda87a0938f35ce9b8291138520d7480c2f3a6/ )
Compiled fine.

http://puu.sh/2cVsx

simba-prev is 993; master is 1000. I'm not sure if you've fixed your problem or not? Latest simba-prev should have it. (There is no _one_ 993 :-)

Justin
03-06-2013, 09:34 AM
simba-prev is 993; master is 1000. I'm not sure if you've fixed your problem or not? Latest simba-prev should have it. (There is no _one_ 993 :-)

Well, that would explain it, Thanks Wizzup