SRL Archive - OSR Help

It's been a while and I need a little help.


Dark_Sniper

2013-07-28 11:55:47

I want to write text into an image debug box. I remember I used to be able to do it in scar, but I'm unsure how to in simba.

The best I see is
"DrawBitmapDebugImg"
I don't see a way to position the image in the image debug.

Basically I want to load something like RS text and have it show up in the debug box.

Or is it better just to do it all in forms?

Rich

2013-07-28 12:05:54

I think what you're after is SMART_DrawTextMulti.

It'd be used like
SMART_DrawTextMulti(False, False, ['[] Time running: ' + TimeRunning ], Point(MCX1 + 15, 453), UpChars, 1120351);

Check out SmartGraphics.simba for loads of functions :)

Oh, and welcome back!

tealc

2013-07-28 12:23:21

From: Dark_Sniper
I want to write text into an image debug box. I remember I used to be able to do it in scar, but I'm unsure how to in simba.

The best I see is
"DrawBitmapDebugImg"
I don't see a way to position the image in the image debug.

Basically I want to load something like RS text and have it show up in the debug box.

Or is it better just to do it all in forms?


I'm not sure if this is what you want but here is an example of DrawBitmapDebugImg, from the include.

procedure DebugBitmap(Bmp: Integer);
var
W, H: Integer;
begin
try
GetBitmapSize(Bmp, W, H);
DisplayDebugImgWindow(W, H);
DrawBitmapDebugImg(Bmp);
except
srl_Warn('DebugBitmap', 'Error in DebugBitmap', warn_AllVersions);
end;
end;

or maybe

program new;
begin

DisplayDebugImgWindow(200, 69)
LoadFont('LoginChars',false);
DrawBitmapDebugImg(BitmapFromText('"ello world','LoginChars'));

end.

Olly

2013-07-28 12:23:46


bmp := createBitmap(500, 500);

tpa := tpaFromText(some params);

drawTPABitmap(bmp, tpa, clRed);

displayDebugImgWindow(500, 500);
drawBitmapDebugImg(bmp);

freeBitmap(bmp);



wrote it in browser, might not be 100% accurate but its pretty damn close :p

Sjoe

2013-07-28 13:44:20

Damn I remember your avatar from back in 2006 :p

Dark_Sniper

2013-07-29 17:52:05

From: Rich
I think what you're after is SMART_DrawTextMulti.

It'd be used like
SMART_DrawTextMulti(False, False, ['[] Time running: ' + TimeRunning ], Point(MCX1 + 15, 453), UpChars, 1120351);

Check out SmartGraphics.simba for loads of functions :)

Oh, and welcome back!



This appears to be perfect!
How do I use this?

{$I SRL/SRL/misc/SmartGraphics.simba}

I get an error when I include it :

[Error] C:\Simba\Includes\srl/srl/misc\SmartGraphics.simba(25:3): Unknown identifier 'SmartSetDebug' at line 24
Compiling failed.


I cannot figure this out….

Sjoe

2013-07-29 17:59:18

From: Dark_Sniper
This appears to be perfect!
How do I use this?

{$I SRL/SRL/misc/SmartGraphics.simba}

I get an error when I include it :

[Error] C:\Simba\Includes\srl/srl/misc\SmartGraphics.simba(25:3): Unknown identifier 'SmartSetDebug' at line 24
Compiling failed.


I cannot figure this out….


U gotta use smartgraphics with Smart

{$Define Smart8} or {$Define Smart} if you're using Smart 7.2
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/SmartGraphics.Simba}

Dark_Sniper

2013-07-29 20:13:49

I would search but don't have time right now.
I updated to smart8.. and now :

[Error] C:\Simba\Includes\SRL/SRL/misc/SmartParams.Simba(293:131): Invalid number of parameters at line 292
Compiling failed.


Quick fix.
Man I sure feel dumb today.

this is the line it points out :
Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 553, 's', '', '');

Le Jingle

2013-07-29 20:43:28

  • DL SRL6 zip, place extracted files into c/simba/includes
  • (should be something like c/simba/includes/lib/ and c/simba/includes/srl.simba) https://github.com/SRL/SRL-6/archive/master.zip
  • If you have the SMART 8.2 Binaries in the plugin folder already then that's good
  • Also get the latest simba build from the online builder (for nose-bleed releases, ex. really up to date)
  • http://l0.lt

I'd just save the image like so:

var
TPA: TPointArray;
bmp: TMufasaBitmap;
w, h: Integer;

begin
TPAFromTextWrap('Example', 'SmallChars', w, h, TPA);
with bmp do
begin
Init();
SetTransparentColor(0);
SetSize(w, h);
DrawTPA(TPA, 255);
SaveToFile('C:\Simba\test.bmp');
Free;
end;
end.

Just offering a different point of view, probably not precisely the route you want either but it's valued information nonetheless! :)

Cheers
Le Jingle

NKN

2013-07-29 22:02:32

From: Dark_Sniper
I would search but don't have time right now.
I updated to smart8.. and now :

[Error] C:\Simba\Includes\SRL/SRL/misc/SmartParams.Simba(293:131): Invalid number of parameters at line 292
Compiling failed.


Quick fix.
Man I sure feel dumb today.

this is the line it points out :
Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 553, 's', '', '');

add '' to the end of that line as an extra parameter