Lets do some resizing of Objects!
Kind of a tutorial, kind of not...
Sunday, October 16, 2005 by CerebroJD | Discussion: DesktopX Tutorials
There may be a better way to do this, but I've found that this works quite well. This code only does a horizontal resize, but its pretty easy to duplicate it to work for both X and Y. I know, because I've got the fully finished script here, but this'll be part of the challenge of learning. Learn by duplication! Now, its important to note that this just resizes the ONE main object. In order to resize objects within that object, you'll need to add a "Sub Object_OnSize(width,height)" sub in the main object to dynamically change the widths of inner elements. That make sense? Ok, good. Heres the code, which you put into the 'dragable' resizer object, whose parent is the main object. It is NOT a child object! With that said, good luck!
Sub Object_OnDrag(x,y,newX,newY)
Object.Top = DesktopX.Object("TutorialBG").Top + 18
If newX - DesktopX.Object("TutorialBG").Left + 50 > 300 Then
DesktopX.Object("TutorialBG").width = newX - DesktopX.Object("TutorialBG").Left + 50
Else
Object.Left = DesktopX.Object("TutorialBG").left + 250
DesktopX.Object("TutorialBG").width = Object.Left - DesktopX.Object("TutorialBG").Left + 50
End If
End Sub
Please note, I made this using this kind of layout:
-------------------------------------- | Parent Object with stuff (resize) | --------------------------------------
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!






