vbGore Free Online RPG Engine

Revolutionizing Visual Basic ORPG Development
It is currently Thu May 23, 2013 1:39 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Animated Button (Differnt Kinda Animation)
PostPosted: Sun Jul 05, 2009 10:01 am 
+3 Gloves of Agility

Joined: Sat Jun 23, 2007 9:42 pm
Posts: 151
Looking into changing the GUI around a bit, and I know how to Make the buttons themself animated. Like when you highlight or click them they do different things. What I been trying to figure out to do is how to make them Slide on Screen.
http://thesacredlands.com/downloads/login_preview.mov

Here is an example of what Im trying to do. When you first open the game, the button slide in from the left to appear on screen, just adds a bit of Eye Candy to the game.

Thanks


Top
 Profile  
 
 Post subject: Re: Animated Button (Differnt Kinda Animation)
PostPosted: Mon Jul 06, 2009 5:24 am 
Bytewise Operator

Joined: Thu Jul 24, 2008 12:44 pm
Posts: 132
Make a timer, when the form loads, the timer is enabled. Also put in Form_Load something like Command.left = Form.ScaleLeft - 20, so the button starts outside of the form. In the sub of the timer, put Command.left = Command.left + 10 (or whatever number you want). And put that if Command.left = 200 (Or whatever the position is you want it to stop at) Timer.Enabled = False.

And change the interval of the timer :)


Top
 Profile  
 
 Post subject: Re: Animated Button (Differnt Kinda Animation)
PostPosted: Wed Jul 08, 2009 2:11 am 
+3 Gloves of Agility

Joined: Sat Jun 23, 2007 9:42 pm
Posts: 151
Would there be a tut around showing something like this, still a bit of a noob never messed with timers or moving pictures around yet, so still learning


Top
 Profile  
 
 Post subject: Re: Animated Button (Differnt Kinda Animation)
PostPosted: Wed Jul 08, 2009 2:31 am 
Bytewise Operator

Joined: Thu Jul 24, 2008 12:44 pm
Posts: 132
What else do you need to know? place a timer on the form and double click it to access the code.


Top
 Profile  
 
 Post subject: Re: Animated Button (Differnt Kinda Animation)
PostPosted: Fri Jul 10, 2009 4:12 am 
+3 Gloves of Agility

Joined: Sat Jun 23, 2007 9:42 pm
Posts: 151
Wasnt much help there but I found a video that was alot more help...though ran into another problem.

I created custom Login buttons for my game, Though I gotten them to work Sorta having problems speeding up the movements. I have them Moving +1 space to the right until they hit a certain spot, at a interval of 50 but it still goes slow the speed doesnt change even if i bump it higher or lower. Only way to make it go fast is to move is to change it from going +1 to like plus 35 but that messes up the alignment.

Under form_Load I put

Code:
Image1 = LoadPicture(App.Path & "\Grh\login_btn.gif")
    Image2 = LoadPicture(App.Path & "\Grh\signup_btn.gif")
    Image3 = LoadPicture(App.Path & "\Grh\options_btn.gif")
    Image4 = LoadPicture(App.Path & "\Grh\exit_btn.gif")
   
    Image1.Left = -Image1.Width '- 90
    Image2.Left = -Image2.Width '- 70
    Image3.Left = -Image3.Width '- 40
    Image4.Left = -Image4.Width '- 20


Then at the end I added

Code:
Private Sub Timer1_Timer()
If Image1.Left < 20 Then
        Image1.Left = Image1.Left + 2
    Else
        Timer1.Enabled = False
        Timer2.Enabled = True
    End If
End Sub

Private Sub Timer2_Timer()
If Image2.Left < 40 Then
        Image2.Left = Image2.Left + 2
    Else
        Timer2.Enabled = False
        Timer3.Enabled = True
    End If
End Sub

Private Sub Timer3_Timer()
If Image3.Left < 70 Then
        Image3.Left = Image3.Left + 2
    Else
        Timer3.Enabled = False
        Timer4.Enabled = True
    End If
End Sub

Private Sub Timer4_Timer()

If Image4.Left < 90 Then
        Image4.Left = Image4.Left + 2
    Else
        Timer4.Enabled = False
    End If
End Sub


thats the only code i put in the game.

4 timers that never run all at once one shuts off then the next starts up

Forgot to add that currently im using gif images for the transparent part but i wanna use PNG because of the center of the button are suppose to be semi transparent if u know of a way to do this be great thanks.

Also Is there Alpha mapping built into vbgore or is it something we gotta put in?


Top
 Profile  
 
 Post subject: Re: Animated Button (Differnt Kinda Animation)
PostPosted: Wed Jul 15, 2009 9:04 pm 
+3 Gloves of Agility

Joined: Sat Jun 23, 2007 9:42 pm
Posts: 151
anyone got any ideas?


Top
 Profile  
 
 Post subject: Re: Animated Button (Differnt Kinda Animation)
PostPosted: Mon Jul 20, 2009 4:52 am 
+3 Gloves of Agility

Joined: Sat Jun 23, 2007 9:42 pm
Posts: 151
Musta really stumped people with this one... There gotta be a way...


Top
 Profile  
 
 Post subject: Re: Animated Button (Differnt Kinda Animation)
PostPosted: Mon Jul 20, 2009 2:04 pm 
Hungry Zombie

Joined: Sat Jun 05, 1976 10:06 pm
Posts: 3179
Location: Auckland, New Zealand
Use directx for the login screen is the easiest way to achieve this..


Top
 Profile  
 
 Post subject: Re: Animated Button (Differnt Kinda Animation)
PostPosted: Mon Jul 20, 2009 5:40 pm 
+3 Gloves of Agility

Joined: Sat Jun 23, 2007 9:42 pm
Posts: 151
Eek yea never tried messing with that yet. lol hmm how would i use directx with this?


Top
 Profile  
 
 Post subject: Re: Animated Button (Differnt Kinda Animation)
PostPosted: Wed Jul 22, 2009 9:04 pm 
Slave to the BB

Joined: Sat May 12, 2007 6:20 am
Posts: 3842
Location: Behind you!
Sadly, I was unable to view the video in all honesty I have no love for quicktime and have no plans on trying to make it work. Upload it to youtube and post it then I'll have a look at it.


Top
 Profile  
 
 Post subject: Re: Animated Button (Differnt Kinda Animation)
PostPosted: Thu Jul 23, 2009 3:22 am 
+3 Gloves of Agility

Joined: Sat Jun 23, 2007 9:42 pm
Posts: 151
Here you go.

http://www.youtube.com/watch?v=HUafLkRiBJY

this is what im trying to do with PNG support but since I cany onlu use GIF in VB6 that are transparent it looks like crap.


Top
 Profile  
 
 Post subject: Re: Animated Button (Differnt Kinda Animation)
PostPosted: Thu Jul 23, 2009 8:10 pm 
Slave to the BB

Joined: Sat May 12, 2007 6:20 am
Posts: 3842
Location: Behind you!
Just use a for loop its actually pretty damn simple to do that.

After the form is up and when you want the buttons to come out do this.

Code:
for i = 0 to 50
{
//start with the second image since the first one starts at it beginning position
image2.x += 1
image3.x += 2
image4.x += 3
}


That should move the bottom 3 images both starting on the right side of the screen and the farther down the faster it moves each of these will have about 50 pixels (or twips idk) between them when the code finishes.


Top
 Profile  
 
 Post subject: Re: Animated Button (Differnt Kinda Animation)
PostPosted: Thu Jul 23, 2009 8:18 pm 
+3 Gloves of Agility

Joined: Sat Jun 23, 2007 9:42 pm
Posts: 151
OO that gave me an idea, but still got my problem, how would i use a PNG image instead of a GIF


Top
 Profile  
 
 Post subject: Re: Animated Button (Differnt Kinda Animation)
PostPosted: Thu Jul 23, 2009 8:53 pm 
Slave to the BB

Joined: Sat May 12, 2007 6:20 am
Posts: 3842
Location: Behind you!
You can't put a png in an image box?


Top
 Profile  
 
 Post subject: Re: Animated Button (Differnt Kinda Animation)
PostPosted: Thu Jul 23, 2009 9:14 pm 
+3 Gloves of Agility

Joined: Sat Jun 23, 2007 9:42 pm
Posts: 151
Na only GIF BMP, and i need the transparent even switch to image boxes instead of pictures and same thing.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next

All times are UTC - 8 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group