SRL Archive - OSR Help

P07 SmartGraphics


Sk1nyNerd

2013-05-05 04:51:07

im trying to display a paint in smart8 but i keep getting this error. i dont want to use the OSR include, only the P07 include

Error: Exception: Access violation at line 78
The following DTMs were not freed: [SRL - Lamp bitmap, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap, SRL - NavBar Bitmap, SRL - Options Bitmap, 5, 6, 7]

i have {$I SRL/SRL/Misc/SmartGraphics.Simba} declared at the top

rj

2013-05-05 10:25:28

Why don't you want to use the OSR include… everything's faster.

Do you have SMART enabled also? And show us your code you might be trying to draw something in correctly

Sk1nyNerd

2013-05-05 12:35:46

because this is a public script, in my private script (OSR) it works where i use the OSR smartgraphics- the error i get lies in here

procedure SMART_ClearCanvas;
begin
if (not SMART_DebugSetup) then
SMART_SetupDebug;

If (SMART_CANVAS.TransparentColorSet) then
SMART_CANVAS.FastDrawClear(SMART_CANVAS.GetTransparentColor)
else
SMART_CANVAS.FastDrawClear(0); //this is line 78
end;


Procedure DrawCustomPaint(st, cp, eg, tg, ca, tr, eh: string);
var PaintPic: integer;
begin
SMART_ClearCanvas;
PaintPic := BitmapFromString(516, 157, 'thebitmap');

SMART_DrawBitmap(False, PaintPic, Point(0, 225));
FreeBitmap(PaintPic);
SMART_DrawText(93,264, UpChars07, 'Status: ', 14545386); //drawing the word status
SMART_DrawText(143,264, Upchars07, st, 14545386);
SMART_DrawText(93,304, UpChars07, 'Competitions Played: ', 14545386); //drawing the word competitions played
SMART_DrawText(234,304, UpChars07, cp, 14545386);
SMART_DrawText(318,304, UpChars07, 'Exp Gained: ', 14545386);
SMART_DrawText(397,304, UpChars07, eg, 14545386);
SMART_DrawText(93,324, UpChars07, 'Tickets Gained: ', 14545386);
SMART_DrawText(195,324, UpChars07, tg, 14545386);
SMART_DrawText(93,344, UpChars07, 'Competitions Before Wielding Arrows: ', 14545386);
SMART_DrawText(342,344, UpChars07, ca, 14545386);
SMART_DrawText(375,354, UpChars07, ForumName, 425678)
SMART_DrawText(93,284, UpChars07, 'Time Running: ', 14545386);
SMART_DrawText(184,284, UpChars07, TimeRunning, 14545386);
SMART_DrawText(318,324, UpChars07, 'Exp Per Hour: ', 14545386);
SMART_DrawText(408,324, UpChars07, eh, 14545386);
end;

wthomas

2013-05-05 14:39:19

It is due to the coordinates you are drawing to the smart screen, to run smart with P07Include you need to alter 3 files, you need to alter some coordinates in smartGraphics to use graphics correctly, you should use SRL-OSR. it has the same functionality and no hacking around in core srl functions…

Sk1nyNerd

2013-05-05 15:42:54

From: wthomas
It is due to the coordinates you are drawing to the smart screen, to run smart with P07Include you need to alter 3 files, you need to alter some coordinates in smartGraphics to use graphics correctly, you should use SRL-OSR. it has the same functionality and no hacking around in core srl functions…


ugh, alright thanks mate! and yes i know, it works fine with my private script. can i atleast write text to smart8 without the bitmap and tinkering around?

is the same true for the GetAmount? I just declared the GetAmount functions in my script but they always say the amount is 0 even though it finds the object im trying to get the amount of