Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support
Sub Shake(ImageToShake,Duration)
'PictureBox(0)will hold the image to shake While PictureBox(1) will have a black background
'------------------------------------------------------------------------------------------
LoadControl PictureBoxObject(0)
LoadControl PictureBoxObject(1)
PictureBoxObject(0).Top = 0
PictureBoxObject(0).Left = 0
PictureBoxObject(0).Height = GetProjectHeight * 15
PictureBoxObject(0).Width = GetProjectWidth * 15
PictureBoxObject(0).Picture = LoadPicture(Action.GetPath + ImageToShake)
PictureBoxObject(1).Top = 0
PictureBoxObject(1).Left = 0
PictureBoxObject(1).Height = GetProjectHeight * 15
PictureBoxObject(1).Width = GetProjectWidth * 15
PictureBoxObject(1).BackColor = &H00000000&
PictureBoxObject(0).ZOrder(0)
PictureBoxObject(1).ZOrder(1)
PictureBoxObject(0).Visible = True
PictureBoxObject(1).Visible = True
'To adjust the shake speed adjust time 0.05 value
'------------------------------------------------
Action.CreateTimedEvent 0.05, "ShakeImage", True
Action.CreateTimedEvent Duration, "StopShaking", False
End Sub
Sub ShakeImage
'To adjust the shake movement change the -20 value, LEFT and TOP can have a different value
'------------------------------------------------------------------------------------------
Randomize
PictureBoxObject(0).Top = int(rnd*(-20))*15
PictureBoxObject(0).Left = int(rnd*(-20))*15
End Sub
Sub StopShaking
'When additional timers are used on the frame adjust the RemoveTimedEvent accordingly
'------------------------------------------------------------------------------------
Action.RemoveTimedEvent 1
PictureBoxObject(0).Visible = False
PictureBoxObject(1).Visible = False
Action.UnloadControl PictureBoxObject(0)
Action.UnloadControl PictureBoxObject(1)
End Sub
Lyberodoggy wrote:The message you get means the engine hasn't found the requested function or the function's values are not properly set... Are you sure you 've pasted the procedures? (not the code in the "Advanced", but this one:)
- Code: Select all
Sub Shake(ImageToShake,Duration)
'PictureBox(0)will hold the image to shake While PictureBox(1) will have a black background
'------------------------------------------------------------------------------------------
LoadControl PictureBoxObject(0)
LoadControl PictureBoxObject(1)
PictureBoxObject(0).Top = 0
PictureBoxObject(0).Left = 0
PictureBoxObject(0).Height = GetProjectHeight * 15
PictureBoxObject(0).Width = GetProjectWidth * 15
PictureBoxObject(0).Picture = LoadPicture(Action.GetPath + ImageToShake)
PictureBoxObject(1).Top = 0
PictureBoxObject(1).Left = 0
PictureBoxObject(1).Height = GetProjectHeight * 15
PictureBoxObject(1).Width = GetProjectWidth * 15
PictureBoxObject(1).BackColor = &H00000000&
PictureBoxObject(0).ZOrder(0)
PictureBoxObject(1).ZOrder(1)
PictureBoxObject(0).Visible = True
PictureBoxObject(1).Visible = True
'To adjust the shake speed adjust time 0.05 value
'------------------------------------------------
Action.CreateTimedEvent 0.05, "ShakeImage", True
Action.CreateTimedEvent Duration, "StopShaking", False
End Sub
Sub ShakeImage
'To adjust the shake movement change the -20 value, LEFT and TOP can have a different value
'------------------------------------------------------------------------------------------
Randomize
PictureBoxObject(0).Top = int(rnd*(-20))*15
PictureBoxObject(0).Left = int(rnd*(-20))*15
End Sub
Sub StopShaking
'When additional timers are used on the frame adjust the RemoveTimedEvent accordingly
'------------------------------------------------------------------------------------
Action.RemoveTimedEvent 1
PictureBoxObject(0).Visible = False
PictureBoxObject(1).Visible = False
Action.UnloadControl PictureBoxObject(0)
Action.UnloadControl PictureBoxObject(1)
End Sub
Return to Adventure Maker Technical Support and Bug Reports
Users browsing this forum: No registered users and 0 guests