none
How to make the screen flash? RRS feed

Answers

  • GraphicsWindow .BrushColor = "#55FF0000" 'transparent red
    GraphicsWindow.PenColor = "#FF0000" 'red
    ErrorShape = Shapes.AddRectangle(GraphicsWindow.Width, GraphicsWindow.Height)
    Shapes.HideShape(ErrorShape)

    Sub
    Error
      For errorI = 1 To 5 
        Shapes.ShowShape(ErrorShape)
        Program.Delay(200)
        Shapes.HideShape(ErrorShape)
        Program.Delay(200)
      EndFor
    EndSub


    And an example of its usage - KKV646
    note: does not work well with SilverLight

    Monday, August 9, 2010 8:54 PM

All replies

  • Show my version NXB478-0.

     


    Best Regards Martin
    • Proposed as answer by _msanders_ Monday, August 9, 2010 8:02 PM
    Monday, August 9, 2010 6:06 PM
  • NXB478-1 , Just make sure FlashLayer is top most

    Sorry My Bad English
    Monday, August 9, 2010 6:35 PM
  • GraphicsWindow .BrushColor = "#55FF0000" 'transparent red
    GraphicsWindow.PenColor = "#FF0000" 'red
    ErrorShape = Shapes.AddRectangle(GraphicsWindow.Width, GraphicsWindow.Height)
    Shapes.HideShape(ErrorShape)

    Sub
    Error
      For errorI = 1 To 5 
        Shapes.ShowShape(ErrorShape)
        Program.Delay(200)
        Shapes.HideShape(ErrorShape)
        Program.Delay(200)
      EndFor
    EndSub


    And an example of its usage - KKV646
    note: does not work well with SilverLight

    Monday, August 9, 2010 8:54 PM
  • NXB478-1 , Just make sure FlashLayer is top most

    Sorry My Bad English

    Your example needs something called FCControls.

    But yes, ak9779, you have to make sure that the image you are going to flash is created last of all so that it is the top most layer. Bit more difficult if you are creating and deleting objects throughout your game as you also have to keep creating and removing the flashing object. Better to just create it when you need it.

    Monday, August 9, 2010 9:51 PM
  • NXB478-1 , Just make sure FlashLayer is top most

    Sorry My Bad English

    Your example needs something called FCControls.

    But yes, ak9779, you have to make sure that the image you are going to flash is created last of all so that it is the top most layer. Bit more difficult if you are creating and deleting objects throughout your game as you also have to keep creating and removing the flashing object. Better to just create it when you need it.

    I have found the best way to maintain shape order is to create them all at the start and keep them hidden until you need them. This is also quicker than creating and removing Shape objects and easier to keep track of order. 

    I find it a bit annoying when people post samples using non standard libraries for something that really doesn't need them. Standard SB all the way for me :D.

    Tuesday, August 10, 2010 11:04 AM
  • Thanks guys. I finished with this:

     

    Sub Flash
     
    DefaultBC = GraphicsWindow.BrushColor 
     
    FlasherVariable = "5"
    Flashing = "True"
    Opacity = 0
    GraphicsWindow.BrushColor = "Red"

    While Flashing = "True"
      Opacity = Opacity + FlasherVariable
      FlashLayer = Shapes.AddRectangle(width, height)
      Shapes.SetOpacity(FlashLayer, Opacity)
      If Opacity = "105" Then
        FlasherVariable = "-1"
      EndIf
      If Opacity = "-1" Then
        Flashing = "False"
      EndIf
      Program.Delay(0.1) 
    EndWhile

    GraphicsWindow.BrushColor = DefaultBC

    EndSub

    Wednesday, August 11, 2010 1:20 AM
  • Thursday, October 6, 2011 7:18 AM
  • To flash a Screen you need to use this code:

     

    runloop:

    GraphicsWindow.BackgroundColor = "RED"

    Program.Delay(200)

    GraphicsWindow.BackgroundColor = "green"

    Program.Delay(200)

    Goto runloop 

    make's it flash red and green

    Saturday, October 8, 2011 3:18 PM