Zoom Effect Script
Monday, September 11, 2006 by SirSmiley | Discussion: DesktopX
Had one effect actually arcing like it was popping out. Lost it in a dx crash unfortunately.
Dim MinW,MaxW
MinW = 48
MaxW = 256
MinH = 48
'This line is in here for future reference. Not functional in this script
MaxH = 256
Sub Object_OnScriptEnter
object.width = MinW
Object.Height = MinH
Object.top = 594
Object.left = 201
End Sub
'You can use place the script below into another object as follows
'Call DesktopX.ScriptObject("effect").Toggle
Sub Object_OnLButtonDown(x,y)
Call Toggle
End Sub
' This Sub actually could be combined with the Grow/Shrink functions. It looks a little nicer this way.
Sub Toggle
If object.width => MinW Then
Call Shrink
Else
Call Grow
End If
End Sub
Function Shrink
object.KillTimer 200
object.SetTimer 100,10
End Function
Function Grow
object.KillTimer 100
object.SetTimer 200,10
End Function
Sub object_ontimer100
If object.width => MinW Then
object.width = object.width - 4
object.height = object.height - 4
object.left = object.left - 8
object.top = object.top + 8
Else
object.KillTimer 100
End If
End Sub
Sub object_ontimer200
If object.width <= MaxW Then
object.width = object.width + 4
object.height = object.height + 4
object.left = object.left + 8
object.top = object.top - 8
Else
object.KillTimer 200
End If
End Sub
Sub Object_OnDropFiles(files)
Object.picture = files
End Sub
Reply #2 Wednesday, September 13, 2006 7:40 PM
Reply #3 Wednesday, September 13, 2006 8:17 PM
| A link from WC to here would be nice even. |
I concur.
SirSmiley you should check out the wiki Zubaz linked. This would be a great addition.
Reply #4 Friday, September 15, 2006 3:27 PM
Many aren't commented well and I want to make things simpler for those who are just starting out. Noticed that most have a tutorial type of format & my submittals may be more of a "script repository" type of post.
Reply #5 Friday, September 15, 2006 3:30 PM
| Many aren't commented well and I want to make things simpler for those who are just starting out. Noticed that most have a tutorial type of format & my submittals may be more of a "script repository" type of post. |
It's a wiki . .maybe someone else will improve on them.
I need all the help I can get.
Reply #6 Friday, September 15, 2006 3:41 PM
| I need all the help I can get. |
You're still meaning the wiki?
Reply #7 Sunday, October 29, 2006 1:39 PM
Working on a project I've streamlined this & achieved a smoother animation... for me at least!
Works nice on a round object.
Dim MinW,MaxW,MinH,MaxH,PosX,PosY
MinW = 26 'Changed from 16 to 26 because of timer script
MaxW = 132
MinH = 26
MaxH = 132
PosX = 500 'Position right from left edge
PosY = 200 'Position down from top edge
'Positions & sizes object on start
Sub Object_OnScriptEnter
Object.Left = PosX
Object.Top = PosY
Object.width = MaxW
Object.Height = MaxH
End Sub
'This controls the animation
'Streamlined the script from multiple subs/functions
Sub Object_OnLButtonUp(x,y,
If Object.width => MinW Then
Object.KillTimer 200
Object.SetTimer 100,25
Else
Object.KillTimer 100
Object.SetTimer 200,25
End If
End Sub
'This shrinks it
Sub Object_ontimer100
If Object.width => MinW Then
Object.Width = Object.Width - 10
Object.Left = Object.Left + 5
Object.Height = Object.Height - 10
Object.Top = Object.Top + 5
Else
Object.KillTimer 100
End If
End Sub
'This grows it
Sub Object_ontimer200
If Object.width <= MaxW Then
Object.Width = Object.Width + 10
Object.Left = Object.Left - 5
Object.Height = Object.Height + 10
Object.Top = Object.Top - 5
Else
Object.KillTimer 200
End If
End Sub
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!







Reply #1 Wednesday, September 13, 2006 6:30 PM
Thanks for sharing that cool effect.
You see, this is what I'm talking about. We need a board specially for tips and tricks.