| Mirage Source http://miragesource.net/forums/ |
|
| Proper Drag-able Boxes http://miragesource.net/forums/viewtopic.php?f=210&t=2859 |
Page 1 of 1 |
| Author: | Tutorial Bot [ Sun Jul 09, 2006 12:41 am ] |
| Post subject: | Proper Drag-able Boxes |
Author: pingu Difficulty: 1/5 :: CLIENT SIDE :: In modDatabase, after "Option Explicit" add: Code: Public SOffsetX As Integer Public SOffsetY As Integer At the bottom of modDatabase, add: Code: Sub MovePicture(PB As PictureBox, Button As Integer, Shift As Integer, x As Single, y As Single) If Button = 1 Then PB.Left = PB.Left + x - SOffsetX PB.top = PB.top + y - SOffsetY End If End Sub Okay, thats all for that portion. Now, let's say we want to make the map editor drag-able. First, add a private sub for the mapeditor pic with mousedown and mousemove: Code: Private Sub picMapEditor_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) SOffsetX = x SOffsetY = y End Sub Private Sub picMapEditor_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) Call MovePicture(frmMirage.picMapEditor, Button, Shift, x, y) End Sub You can do the same thing with other things, too. =) Just follow with the above code. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|