Friday 31 January 2014

Controlling the opacity of a shape using mousemove event

a = Shapes.AddEllipse(100,100)
GraphicsWindow.MouseMove = mousemove

Sub mousemove
  If GraphicsWindow.MouseX <= 100 Then
    Shapes.SetOpacity(a, 100)
  Else
    Shapes.SetOpacity(a,50)
    endif
EndSub

It used to be:
a = Shapes.AddEllipse(100,100)
Shapes.SetOpacity(a,50)
GraphicsWindow.MouseMove = mousemove

Sub mousemove
  If GraphicsWindow.MouseX <= 100 Then
    Shapes.SetOpacity(a, 100)
  Else
    Shapes.SetOpacity(a,50)
    endif
EndSub

Final:

No comments:

Post a Comment