none
Mouse Controls (Color Wand) RRS feed

  • Question

  • Hello everyone! Today I bring to you a... another little program of mine that was had as I was fooling around. "The Color Wand"! when you run this program, it will allow you to move a little"/" around the screen and when you left-click, it will draw a color. Right-click, and it will erase that area of the screen. Just a little fun thing for you all :)

    JXN721

    GraphicsWindow.Clear()
    GraphicsWindow.Title="Color Wand"
    mvfn=10
    GraphicsWindow.MouseMove=move
    GraphicsWindow.MouseDown=down
    GraphicsWindow.BackgroundColor="White"
    GraphicsWindow.BrushColor="Black"
    GraphicsWindow.FontSize=mvfn
    Mouse.HideCursor()
    man=Shapes.AddText("/")

    Sub move
      cx=GraphicsWindow.MouseX-15
      cy=graphicswindow.MouseY-15
      Shapes.Move(man,cx,cy)
    EndSub

    Sub down
      If Mouse.IsLeftButtonDown then
        color=GraphicsWindow.GetRandomColor()
        GraphicsWindow.brushcolor=color
        GraphicsWindow.FillRectangle(cx+5,cy-9,mvfn,mvfn)
      EndIf
      If Mouse.IsRightButtonDown Then
        GraphicsWindow.brushcolor="White"
        GraphicsWindow.FillRectangle(cx+5,cy-9,mvfn,mvfn)
      EndIf
    EndSub
       

    Sunday, May 5, 2013 1:14 AM

Answers

  • Nice! Try this Tho..

    GraphicsWindow.Clear()
    GraphicsWindow.Title="Color Wand"
    mvfn=10
    GraphicsWindow.MouseMove=move
    GraphicsWindow.MouseDown=down
    GraphicsWindow.BackgroundColor="White"
    GraphicsWindow.BrushColor="Black"
    GraphicsWindow.FontSize=mvfn
    Mouse.HideCursor()
    man=Shapes.AddText("/")
    
    While 1 = 1
    Program.Delay(5)
      If Mouse.IsLeftButtonDown then
        color="Red"
        GraphicsWindow.brushcolor=color
        GraphicsWindow.FillRectangle(cx+5,cy-9,mvfn,mvfn)
      EndIf
      If Mouse.IsRightButtonDown Then
        GraphicsWindow.brushcolor="White"
        GraphicsWindow.FillRectangle(cx+5,cy-9,mvfn,mvfn)
        EndIf
      EndWhile
      
    Sub move
      cx=GraphicsWindow.MouseX-15
      cy=graphicswindow.MouseY-15
      Shapes.Move(man,cx,cy)
    EndSub

    Oh BTW, you should change this from a question to a discussion.


    It is written: "'As surely as I live,' says the Lord, 'every knee will bow before me; every tongue will acknowledge God.'" Romans 14:11

    Sunday, May 5, 2013 2:33 AM
    Answerer
  • To make this work:

    remove the line with 

    GraphicsWindow.MouseDown=down

    Jan [ WhTurner ] The Netherlands

    Sunday, May 5, 2013 9:54 AM
    Answerer
  • Ahh yes. My bad. the last thing I did was to remove the "Down" sub :]

    It is written: "'As surely as I live,' says the Lord, 'every knee will bow before me; every tongue will acknowledge God.'" Romans 14:11

    Sunday, May 5, 2013 3:38 PM
    Answerer
  • ardiezc_quazhulu, good program!  I also like bigger mvfn such as mvfn=20.  Thanks.

    Nonki Takahashi

    Tuesday, May 7, 2013 1:59 AM
    Moderator

All replies

  • Nice! Try this Tho..

    GraphicsWindow.Clear()
    GraphicsWindow.Title="Color Wand"
    mvfn=10
    GraphicsWindow.MouseMove=move
    GraphicsWindow.MouseDown=down
    GraphicsWindow.BackgroundColor="White"
    GraphicsWindow.BrushColor="Black"
    GraphicsWindow.FontSize=mvfn
    Mouse.HideCursor()
    man=Shapes.AddText("/")
    
    While 1 = 1
    Program.Delay(5)
      If Mouse.IsLeftButtonDown then
        color="Red"
        GraphicsWindow.brushcolor=color
        GraphicsWindow.FillRectangle(cx+5,cy-9,mvfn,mvfn)
      EndIf
      If Mouse.IsRightButtonDown Then
        GraphicsWindow.brushcolor="White"
        GraphicsWindow.FillRectangle(cx+5,cy-9,mvfn,mvfn)
        EndIf
      EndWhile
      
    Sub move
      cx=GraphicsWindow.MouseX-15
      cy=graphicswindow.MouseY-15
      Shapes.Move(man,cx,cy)
    EndSub

    Oh BTW, you should change this from a question to a discussion.


    It is written: "'As surely as I live,' says the Lord, 'every knee will bow before me; every tongue will acknowledge God.'" Romans 14:11

    Sunday, May 5, 2013 2:33 AM
    Answerer
  • To make this work:

    remove the line with 

    GraphicsWindow.MouseDown=down

    Jan [ WhTurner ] The Netherlands

    Sunday, May 5, 2013 9:54 AM
    Answerer
  • Ahh yes. My bad. the last thing I did was to remove the "Down" sub :]

    It is written: "'As surely as I live,' says the Lord, 'every knee will bow before me; every tongue will acknowledge God.'" Romans 14:11

    Sunday, May 5, 2013 3:38 PM
    Answerer
  • ardiezc_quazhulu, good program!  I also like bigger mvfn such as mvfn=20.  Thanks.

    Nonki Takahashi

    Tuesday, May 7, 2013 1:59 AM
    Moderator