Results 1 to 12 of 12

Thread: Printonsmart words over bitmap

  1. #1
    Join Date
    Dec 2011
    Posts
    1,162
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Printonsmart words over bitmap

    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!


  2. #2
    Join Date
    Oct 2006
    Posts
    1,211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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/
    Extinct.

    Formally known as Drags111.

  3. #3
    Join Date
    Dec 2011
    Posts
    1,162
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

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

  4. #4
    Join Date
    Dec 2011
    Posts
    1,162
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

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

  5. #5
    Join Date
    Oct 2006
    Posts
    1,211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

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

    Formally known as Drags111.

  6. #6
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Quote Originally Posted by laakerules View Post
    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.

  7. #7
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    I do it in this script:
    http://www.youtube.com/watch?v=RSFNP...ature=youtu.be

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

    Simba Code:
    {*******************************************************************************
    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!

  8. #8
    Join Date
    Dec 2011
    Posts
    1,162
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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.
    Last edited by laakerules; 01-30-2012 at 05:07 AM.

  9. #9
    Join Date
    Jan 2012
    Location
    Minneapolis, Mn
    Posts
    185
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  10. #10
    Join Date
    Dec 2011
    Posts
    1,162
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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.

  11. #11
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by laakerules View Post
    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,

  12. #12
    Join Date
    Dec 2011
    Posts
    1,162
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •