Microsoft Small Basic

Program Listing: CSC163-0

' slides show porgram by Yvan Leduc
' modified by Nonki Takahashi
' July 17th 2016

' program no: CSC163-0

GraphicsWindow.Top = 0
GraphicsWindow.Left = 0
gw = 1366
gh = 768
GraphicsWindow.Width = gw
GraphicsWindow.Height = gh
GraphicsWindow.BackgroundColor = "Black"
GraphicsWindow.FontName = "Segoe Script"
GraphicsWindow.FontSize = 20

url[1]="https://rstorage.filemobile.com/storage/26472702/1551"
url[2]="https://rstorage.filemobile.com/storage/26472818/1551"
url[3]="https://rstorage.filemobile.com/storage/26472615/1551"
url[4]="https://rstorage.filemobile.com/storage/26462295/1551"
url[5]="https://rstorage.filemobile.com/storage/26462369/1551"

AddCircles() ' show loading circles
For st = 1 To 5 ' load picures
image = ImageList.LoadImage(url[st])
img[st] = Shapes.AddImage(image)
Shapes.Move(img[st],100,10)
Shapes.SetOpacity(img[st], 0)
EndFor
GraphicsWindow.BrushColor = "DarkBlue"
txt = Shapes.AddText(" Photo by Yvan Leduc 2016")
Shapes.SetOpacity(txt, 0)
Shapes.Move(txt, 800, 650)
Timer.Pause()
Program.Delay(100)
RemoveCircles()

For times = 1 To 2
For st =1 To 5 ' st for slide time to show 3 seconds
For op = 0 To 100
Shapes.SetOpacity(img[st], op)
Shapes.SetOpacity(txt, op)
Program.Delay(10)
EndFor
Program.Delay(3000)
For op = 100 To 0 Step -1
Shapes.SetOpacity(txt, op)
Shapes.SetOpacity(img[st], op)
Program.Delay(10)
EndFor
EndFor
EndFor

GraphicsWindow.FontSize = 100
GraphicsWindow.DrawBoundText(600, 300, 500, " The End")

Sub AddCircles
xo = gw / 2
yo = gh / 2
i = 0
GraphicsWindow.BrushColor = "White"
GraphicsWindow.PenWidth = 0
For θ = 0 To 340 Step 20
i = i + 1
ell[i] = Shapes.AddEllipse(16, 16)
x = xo + 60 * Math.Sin(Math.GetRadians(θ))
y = yo - 60 * Math.Cos(Math.GetRadians(θ))
Shapes.Move(ell[i], x - 8, y - 8)
Shapes.SetOpacity(ell[i], 10)
EndFor
i = 1
n = Array.GetItemCount(ell)
Timer.Interval = 100
Timer.Tick = OnTick
EndSub

Sub RemoveCircles
For i = 1 To n
Shapes.Remove(ell[i])
EndFor
EndSub

Sub OnTick
Stack.PushValue("local", i)
i = i + 4
If n < i Then
i = Math.Remainder(i, n)
EndIf
For op = 50 To 10 Step -10
Shapes.SetOpacity(ell[i], op)
i = i - 1
If i < 1 Then
i = n
EndIf
EndFor
i = Stack.PopValue("local")
i = i + 1
If n < i Then
i = 1
EndIf
EndSub