Platforms to show: All Mac Windows Linux Cross-Platform
/Util/Resplugin Examples/Thunder
Required plugins for this example: MBS Util Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Util/Resplugin Examples/Thunder
This example is the version from Wed, 20th Jun 2017.
Project "Thunder.xojo_binary_project"
Class Thunder Inherits Window
Control Draw Inherits Canvas
ControlInstance Draw Inherits Canvas
EventHandler Function MouseDown(X As Integer, Y As Integer) As Boolean
dis.FadeGamma(1000, RGB(0, 0, 0))
thunderMode = 1
MyTimer.Mode = 2 'Switch timer on
End EventHandler
EventHandler Sub Paint(g As Graphics, areas() As REALbasic.Rect)
g.DrawPicture(FrenchAlps, 0, 0, Width, Height, 0, 0, FrenchAlps.Width, FrenchAlps.Height)
If dis.GammaIntensity = 0 And dis.GammaColor = RGB(0, 0, 0) Then
dis.FadeGammaTo(600, RGB(0, 0, 0), 500) 'Fade back if this is the first time
End If
End EventHandler
End Control
Control MyTimer Inherits Timer
ControlInstance MyTimer Inherits Timer
EventHandler Sub Action()
// Draw.MouseDown faded the screen the first time:
// dis.FadeGamma(1000, RGB(0, 0, 0))
// This code fades the screen three more times:
// dis.FadeGamma(200, RGB(255, 255, 255))
// dis.FadeGamma(1000, RGB(0, 0, 0))
// dis.FadeGamma(600, RGB(0, 0, 0))
If dis.GammaIntensity = 1000 Then
If thunderMode = 1 Then
dis.FadeGamma(200, RGB(255, 255, 255))
Else
dis.FadeGamma(600, RGB(0, 0, 0)) 'Fade back to normal
Me.Mode = 0 'We are done. Switch timer off
End If
Else
dis.FadeGamma(1000, RGB(0, 0, 0))
thunderMode = 0
End If
End EventHandler
End Control
EventHandler Sub Close()
if dis<>nil then
dis.FadeGammaTo(0, RGB(0, 0, 0), 500)
Hide
// Destroy our Display object (fades to normal)
dis = nil
end if
End EventHandler
EventHandler Function KeyDown(Key As String) As Boolean
if key=chr(27) then
close
return true
end if
End EventHandler
EventHandler Sub Open()
Dim file As FolderItem
if not ResolutionLibraryPresentMBS then
msgBox "The library RezLib was not found. Please place this library into the Realbasic or after compiling into your application folder."
end if
// Find the monitor
dis = GetDisplayMBS(0)
if dis<>Nil then
// Set the position
Left = dis.Left
Top = dis.Top
Width = dis.Width
Height = dis.Height
// Show the window
dis.FadeGammaTo(0, RGB(0, 0, 0), 1000)
Show
end if
End EventHandler
Property dis As DisplayMBS
Property thunderMode As Integer
End Class
MenuBar Menu
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu7 = ""
MenuItem UntitledMenu2 = "File"
MenuItem FileQuit = "Quit"
MenuItem UntitledMenu6 = ""
MenuItem UntitledMenu0 = "Edit"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cut"
MenuItem EditCopy = "Copy"
MenuItem EditPaste = "Paste"
MenuItem EditClear = "Clear"
MenuItem UntitledMenu5 = ""
MenuItem UntitledMenu4 = ""
End MenuBar
ExternalFile FrenchAlps
End ExternalFile
Class App Inherits Application
End Class
End Project
See also:
The items on this page are in the following plugins: MBS Util Plugin.