All of my skins I am developing now
Need a little help!!!
Published on June 13, 2008 By Automan In DesktopX Tutorials

Hi folks;

I have a menu system built into my DesktopX theme, and I need a little scripting help?

I am building in Photoshopcs3 all of the png files for certain links and task like Utilities, Media,Office,etc.

Now I make the images at 64 pixels an I am trying to use cod to make the images change size to 72 pixels with " Mouse over".

I need a way to increase the size just like Object dock plus. Increase the size with code so the it will enlarge the image to jump out to the 72 pixels.

Can someone help me on this, I need it to move smoothly to the larger size.

Thanks folks!!!

Automan


Comments (Page 1)
2 Pages1 2 
on Jun 13, 2008
Code: vbscript
  1. 'Called on mouse over object
  2. Sub Object_OnMouseEnter
  3. Object.Resize 72,72
  4. End Sub
  5. 'Called when mouse leaves object
  6. Sub Object_OnMouseLeave
  7. Object.Resize 64,64
  8. End Sub
on Jun 13, 2008
'Called on mouse over object
Sub Object_OnMouseEnter
Object.Resize 72,72
End Sub

'Called when mouse leaves object
Sub Object_OnMouseLeave
Object.Resize 64,64
End Sub


Didnt work for me.
on Jun 13, 2008
Worked here

How would you make it grow from the center?
on Jun 13, 2008
Does the object need to have 1 state or two? Does it need to be named object? I know I sound dumb...lol.
on Jun 13, 2008
No and no.
on Jun 13, 2008
No and no.


No and no what? 1 or 2 states?
on Jun 13, 2008
Got it now, 1 state works! Thanx!
on Jun 13, 2008
Hello again folks;

Looks like we are kind of missing the idea here, as when you use the code here which I have used to resize before; it will move the png image larger and down to the bottom left by a little bit. This would also need to have a - off set to make the image just grow larger.

The one thing I am trying to do is set the image to spring out larger just like Object dock plus.

Object dock moves the image at a smooth pace to the larger size instead of just jumping to the resize, thus forth there has to be away to get the alignment right and also get the smooth slowe spring up action.

Any ideas using a little math maybe?

Thanks for all the help here, if this can be done, then any part of an object on the desktop can be set by vbcode to move in the same fasion.

Thanks again for the brain work. It's really appreciated!

Automan
on Jun 13, 2008
You won't get the same smoothness as objectdock without a timer. Pretty sure I have something in my code base...here you go.
Code: vbscript
  1. Dim MinW,MaxW
  2. MinW = 64
  3. MaxW = 128
  4. MinH = 64
  5. MaxH = 72
  6. Sub Object_OnScriptEnter
  7. object.width = MinW
  8. Object.Height = MinH
  9. End Sub
  10. 'Called on mouse over object
  11. Sub Object_OnMouseEnter
  12. Call Grow
  13. End Sub
  14. 'Called when mouse leaves object
  15. Sub Object_OnMouseLeave
  16. Call Shrink
  17. End Sub
  18. Function Shrink
  19. object.KillTimer 200
  20. object.SetTimer 100,10
  21. End Function
  22. Function Grow
  23. object.KillTimer 100
  24. object.SetTimer 200,10
  25. End Function
  26. Sub object_ontimer100
  27. If object.width => MinW Then
  28. object.width = object.width - 4
  29. object.height = object.height - 4
  30. Object.Left = Object.Left + 2
  31. Object.Top = Object.Top + 2
  32. Else
  33. object.KillTimer 100
  34. End If
  35. End Sub
  36. Sub object_ontimer200
  37. If object.width <= MaxW Then
  38. object.width = object.width + 4
  39. object.height = object.height + 4
  40. Object.Left = Object.Left - 2
  41. Object.Top = Object.Top - 2
  42. Else
  43. object.KillTimer 200
  44. End If
  45. End Sub
on Jun 13, 2008
There's an error MaxW=128 should be MaxW=72.
on Jun 13, 2008
A little cleaner script.

Code: vbscript
  1. Dim MinW,MaxW
  2. MinW = 64
  3. MaxW = 128
  4. MinH = 64
  5. MaxH = 72
  6. Sub Object_OnScriptEnter
  7. object.width = MinW
  8. Object.Height = MinH
  9. End Sub
  10. 'Called on mouse over object
  11. Sub Object_OnMouseEnter
  12. Call Grow
  13. End Sub
  14. 'Called when mouse leaves object
  15. Sub Object_OnMouseLeave
  16. Call Shrink
  17. End Sub
  18. Function Shrink
  19. object.KillTimer 200
  20. object.SetTimer 100,10
  21. End Function
  22. Function Grow
  23. object.KillTimer 100
  24. object.SetTimer 200,10
  25. End Function
  26. Sub object_ontimer100
  27. If object.width => MinW Or object.Height=> MinH Then
  28. object.Resize object.Width-4,object.Height-4
  29. object.Move object.Left+2,object.Top+2
  30. Else
  31. object.KillTimer 100
  32. End If
  33. End Sub
  34. Sub object_ontimer200
  35. If object.Width<=MaxW Or object.Height<=MaxH Then
  36. object.Resize object.Width+4,object.Height+4
  37. object.Move object.Left-2,object.Top-2
  38. Else
  39. object.KillTimer 200
  40. End If
  41. End Sub
on Jul 26, 2008
i think i have seen that code somewhere before.

lol
on Aug 03, 2008
Somewhere!
...Where?
on Sep 02, 2008
Hi folks;

Great job on the code here, I have it working, but a always when you think youn have it perfect you find a change that would make it even better. So here goes.

Most of us have seen the new Impulse Ver.2 and it is slick! My only problem is that I don't want it running in memory all the time. So I turned and looked at my Menu system and presto it hit me.

In the new impulse there is a mouse over event that uses a black bar that when presed it will change to orange. This being said, I decided to mae my menu just like impulse but with out all the goodies thatn it has. Below is a list of what I am trying to do.

1 DesktopX pops open the menu.
2 When your mouse passes over the text name of the object it wii show the "Black Image".
Also I need a call to png "Icon image to make it use the code that was made before on the icon image to grow to the max height or on leave shrink back down to the correct state, This where I get into trouble..How do you call the resize code that is in the Icon to make it 92 as if the mouse was over it and the shrink it back down when the mouse leaves the text and bar

I will post an image of what I'm trying to do in a few minutes.

Anyway if you have seen the new Impulse and move your mouse over the menu like " My Desktop"
The change is rally cool!!!!

DesktopX PopUp
Mouse over = Black then
om Mouse pause over the Icon and the bar will switch to a gold/orange bar and text stays the same color unless you want it to...On click program startsm

I hope all of this has made a little sense, sounds cool anyway.........

Thanks a million guys and gals......


Automn   

Automan




on Sep 02, 2008

Have you considered using animation strips instead of script?  They might work better for this.

2 Pages1 2