Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21

Thread: Vesta Forever - mini game for Linux

  1. #11
    No doubt I'm making some mistake, because nothing shows. All I managed to do so far is to make the invisible paintbox clickable.

  2. #12
    Quote Originally Posted by Jonax View Post
    No doubt I'm making some mistake, because nothing shows. All I managed to do so far is to make the invisible paintbox clickable.
    Would you mind showing your current code. Maybe I could diagnose your problem.

  3. #13
    Quote Originally Posted by SilverWarior View Post
    Would you mind showing your current code. Maybe I could diagnose your problem.
    Thanks. I'll try to clean up some mess and junk and post the attempt later.

  4. #14
    Update:

    While cleaning up the code mess suddenly at least something appeared on the paintbox.
    That is a rectangle painted in Green. For reference I had an image (imgRight) next to the painbox...
    The code below painted the image red and the painbox green. Unfortunately no persistence.
    As soon as either part was clicked the paintbox became erased / invisible
    Still better than previous attempts.

    Code snippet for initiating the coloring below.

    recMAIN.canvas.Brush.Color := clRed;
    recMAIN.canvas.FillRect(jPaintBoxWidd, 0, jRecMainWidd, jRecMainHei);


    paintBox1.canvas.Brush.Color := clGreen;
    paintBox1.canvas.FillRect(0, 0, jPaintBoxWidd, jRecMainHei);


    imgRight.canvas.copyrect(rect(0, 0, jRecMainWidd, jRecMainHei),
    recMAIN.canvas, rect(jPaintBoxWidd, 0, jRecMainWidd, jRecMainHei));

  5. #15
    Where do you call this code?

  6. #16
    Just a test program. The code snippet is is called by clicking a panel

  7. #17
    Quote Originally Posted by Jonax View Post
    The code snippet is is called by clicking a panel
    That is the problem. This code should be inside OnPaint event of TPaintBox. Your click should only call PaintBox.Invalidate. This then forces the paint box to start redrawing itself and consequently also executes the OnPaint event. Of course before and after OnPaint event some additional needed code is also automatically called.

  8. #18

  9. #19
    Seems to work. I'll try a new mini project with this method. Thanx Silver

  10. #20
    Quote Originally Posted by Jonax View Post
    Seems to work. I'll try a new mini project with this method. Thanx Silver
    I'm anxiously waiting to see what you will come up with.

Page 2 of 3 FirstFirst 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

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