SRL Archive - Help

Printonsmart words over bitmap


laakerules

2012-01-29 18:08:03

Have Words over bitmap. How would i do this, curently it over writes it but creats a blank space inside my bitmap image. How can i make it keep the bitmap image in the back and then print something on that. I am doing this to make an ingame proggy, and yes the bitmap to image is incrementally larger than normal. But who cares things like this in a script make it awesome! :)


Drakan

2012-01-29 20:46:15

When using paintsmart, whatever comes second will paint over whatever is painted first. You want to paint the BitMap first then paint the text over it. Here I have a small sample on how to do that. When you need to update the text it is necessary to clear whatever text was there before. To do this, you may want to break the bitmaps up so you dont have to refresh the entire bitmap each time it needs to repaint.

http://paste.villavu.com/show/1896/

laakerules

2012-01-29 20:51:29

Cool ill try that out after im done making my new walking methods.

laakerules

2012-01-29 21:43:26

Ouhh thanks got it working. It looks sick, except for the frieking massive BMP inside the script! :P

Drakan

2012-01-29 23:40:13

Haha yeh those can be ugly ;) Glad you got it working.

mormonman

2012-01-29 23:44:02

From: laakerules
Ouhh thanks got it working. It looks sick, except for the frieking massive BMP inside the script! :P


Create a sliver of the texture and just draw it as big as you want it(use a loop with an x value multiplier), like this forum's background.

YoHoJo

2012-01-29 23:46:01

I do it in this script:
http://www.youtube.com/watch?v=RSFNPTWTtKw&feature=youtu.be

Also when doing BMPToString UNTICK the Padr Output box, then your bitmap code will be just one line.

{*******************************************************************************
procedure SMART_DrawBitmapWithTextMulti(Clear: Boolean; Bitmap: Integer; BmpPlacement: TPoint; TP: TStringArray; Shadow: Boolean; TxtPlacement: TPoint; Font: string; Colour: TColor);
By: Euphamism (THANKS A LOT!)
Description: Debugs bitmap with text on top. Only text refreshes, so no flashing
*******************************************************************************}
procedure SMART_DrawBitmapWithTextMulti(Clear: Boolean; Bitmap: Integer; BmpPlacement: TPoint; TP: TStringArray; Shadow: Boolean; TxtPlacement: TPoint; Font: string; Colour: TColor);
var
I, B, H, Pic, TPH, Numb: Integer;
Offset: TPoint;
TTP: TPointArray;
Canvas: TCanvas;
begin

if (not SMART_DebugSetup) then
SMART_SetupDebug();

{if (Clear) then
SMART_ClearCanvasArea( PointToBox( Point(MSX1, MSY1) , Point(MSX2, MSY2) ) );
SMART_ClearCanvas();}

TPH := High(TP);

Offset := IntToPoint(TxtPlacement.x - BmpPlacement.x, TxtPlacement.y - BmpPlacement.y);

Pic := CopyBitmap(Bitmap);

for I := 0 to TPH do
begin

TTP := LoadTextTPA(TP[i], SmallChars, H);

for B := 0 to High(TTP) do
begin

Numb := ((I + 1) * 13);

if Shadow then
try

FastSetPixel(Pic, TTP[b].x + 1 + Offset.x , TTP[b].y + Numb + 1 + Offset.y,131072);
except
end;

try

FastSetPixel(Pic, TTP[b].x + Offset.x, TTP[b].y + Numb + Offset.y, Colour);
except
end;
end;
end;

Canvas := TCANVAS.Create;
Canvas.Handle := SmartGetDebugDC;
DrawBitmap(Pic, Canvas, BmpPlacement.x, BmpPlacement.y);
FreeBitmap(Pic);
end;

Euphamism made me that, helpful to write text on a bitmap without it crapping up for flashing or anything lame like that, its really cool!

laakerules

2012-01-30 00:01:45

Lol ok, thanks YoHo. The only thing i dont like is how it flashes through retyping like a Wave though the text.


Thats how it looks now.

Inception

2012-01-30 00:12:14

That looks pretty fancy! Nice work!

laakerules

2012-01-30 00:16:05

Thank you, only issue that i wish would be cooler is the wave affect that the text has when it updates or the text flash when it updates. I wish it would just be updated 100% like injection bots that would be cool.

putonajonny

2012-01-30 11:41:42

From: laakerules
Thank you, only issue that i wish would be cooler is the wave affect that the text has when it updates or the text flash when it updates. I wish it would just be updated 100% like injection bots that would be cool.


The wave effect is annoying, you could get rid of it by making it only clear the parts of the screen with variables on them,

laakerules

2012-01-30 21:02:40

Ya i fixed it up so my new version doesnt wave but just the variables1:)