Results 1 to 7 of 7

Thread: Drawing objects on screen?

  1. #1
    Join Date
    Mar 2013
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default Drawing objects on screen?

    what's the best way to go about drawing objects onto the smart client, i.e. circles etc.?

    e.g. drawing a small circle somewhere on the minimap at coords x,y?

  2. #2
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Simba Code:
    procedure SMART_DrawCircle(Clear: Boolean; Center: TPoint; Radius: Integer; Fill: Boolean; Color: TColor);

    //example:

    SMART_DrawCircle(False, Point(252, 50), 5, False, clRed);

    if 'Fill' is true it will fill the circle, otherwise it draws just the border.
    if 'Clear' is true it will clear the SMART Canvas: meaning it will remove the drawing.

    Insert your coords x,y in Point(x,y)

    Creds to DannyRS for this wonderful sig!

  3. #3
    Join Date
    Mar 2013
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by Sjoekeloe View Post
    Simba Code:
    procedure SMART_DrawCircle(Clear: Boolean; Center: TPoint; Radius: Integer; Fill: Boolean; Color: TColor);

    //example:

    SMART_DrawCircle(False, Point(252, 50), 5, False, clRed);

    if 'Fill' is true it will fill the circle, otherwise it draws just the border.
    if 'Clear' is true it will clear the SMART Canvas: meaning it will remove the drawing.

    Insert your coords x,y in Point(x,y)
    awesome! this'll make debugging so much easier =D


    oh, i forgot to ask... deleting/moving the circle around?

    or better yet would probably be documentation of the smart functions?


    haven't found the documentation but i did find this function...

    Simba Code:
    procedure SMART_ClearCanvasArea(Area: TBox);

    would constant clearing/redrawing to keep it updated lag up the processing of the script too much? or would there be a better way to keep the objects where i need them dynamically?


    oh and another edit... if that is the way to do it (constant clear/redraw) is there a way to multithread so I can have it running while my script is running? yes, I know i can just put it in the main loop, but i'd rather multithread it if possible
    Last edited by ookamocka; 03-09-2013 at 04:56 PM.

  4. #4
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    TTimer, doesn't work as far as I know; thus multithreading with your current build won't happen in the script runtime.

    You can, however, add some waits to your loops to help lower intensive CPU functions.

  5. #5
    Join Date
    Mar 2013
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by Le Jingle View Post
    TTimer, doesn't work as far as I know; thus multithreading with your current build won't happen in the script runtime.

    You can, however, add some waits to your loops to help lower intensive CPU functions.
    oh, well that sucks =/

    so would repeated drawing/clearing be the best way of keeping objects drawn dynamically on the screen/

  6. #6
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Quote Originally Posted by ookamocka View Post
    oh, well that sucks =/

    so would repeated drawing/clearing be the best way of keeping objects drawn dynamically on the screen/
    Yes, for if the object moves, you'd need to redraw it, thus done via clearing a canvas area (less intensive for clearing a smaller area, rather than clearing the entire screen).

  7. #7
    Join Date
    Mar 2013
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by Le Jingle View Post
    Yes, for if the object moves, you'd need to redraw it, thus done via clearing a canvas area (less intensive for clearing a smaller area, rather than clearing the entire screen).
    sounds good.

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
  •