Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Banned
    Join Date
    Oct 2011
    Posts
    863
    Points
    1,141
         User Info     Contact     Gamer ID
    Join Date
    Oct 2011
    Posts
    863
    Points
    1,141
    Gamer IDs

    Steam ID: buttholemonger

    Contact info:

    Youtube Channel: youtube.com/triixsoldier

    Default [VB.Net] Theme making, MouseStates, what are they, and why use them?

    This is a little tutorial for people just starting to create themes for Visual Basic. I'll just be explaining MouseStates, and what you can do with them. If you don't know how to setup the start of a theme, just go grab AeonHacks theme base. Here

    Alrighty, so let's get started.

    First, make a new Sub, like this.
    Code:
    Sub Weary()
            SetColor("Button", Color.SkyBlue)
            SetColor("Text", Color.Black)
            SetColor("Border", Color.Black)
        End Sub
    This will set the button main color to SkyBlue, the Text to black, and the Border to black. Well, it can be used for other things in the theme other then a button, but for the sake of the tutorial, let's go with that :P.

    Second, go to your colorhook and input this.
    Code:
           ButtonColor = GetColor("Button")
            TextColor = GetBrush("Text")
            Border = GetPen("Border")
    Third, go to your PaintHook of whatever class you want to apply a MouseState to, and enter this.

    Code:
    Select case state
     Case MouseState.None
    
    End Select
    So between Case MousState.None & End Select, is where we will insert the code for how the button will look, when nothing is happening. Here's an example.

    Code:
    Select case state
     Case MouseState.None
        G.DrawRectangle(Border, Weary Rectangle(0, 0, Width - 1, Height - 1))
                    DrawText(TextColor, HorizontalAlignment.Center, 0, 0)
    End Select
    The G.DrawRectangle bit, draws the button its-self with a border around it. The DrawText bit, draws the text centered in the middle of the button. You can change the position using the zero's at the end, the X, and the Y.

    So that covers the button when nothing is happening, but now let's move on to when your mouse is hovering over the button.

    So, it's basically the same thing, except this time the case is different.

    Code:
      Case MouseState.Over
    Then below Case MoustState.Over, add what you want the button to look like when it's being hovered over.

    Tip: You can just C+P from the Case MouseState.None and change a few things and it will look nice.


    Okay, so now let's move on to when the button is clicked.
    Code:
       Case MouseState.Down
    It's the same as the others, except it only appears when it's clicked.

    0 Not allowed! Not allowed!

  2. #2
    Member MUFFINFIBER's Avatar
    Join Date
    Aug 2012
    Location
    Living With The Narwhals <3
    Posts
    151
    Points
    390
         User Info     Contact     Gamer ID
    Join Date
    Aug 2012
    Location
    Living With The Narwhals <3
    Posts
    151
    Points
    390
    Gamer IDs

    Gamertag: N0SI11A

    Default

    Nice tutorial

    0 Not allowed! Not allowed!


    NAWRWALS ARE AWESOME!!!!!!!!!!!

    WIIU>XBOX 360 and PS3

  3. #3
    Banned
    Join Date
    Oct 2011
    Posts
    863
    Points
    1,141
         User Info     Contact     Gamer ID
    Join Date
    Oct 2011
    Posts
    863
    Points
    1,141
    Gamer IDs

    Steam ID: buttholemonger

    Contact info:

    Youtube Channel: youtube.com/triixsoldier

    Default [VB.Net] Theme making, MouseStates, what are they, and why use them?

    Thanks. Wish more people knew the language.

    0 Not allowed! Not allowed!

  4. #4
    Diehard cheatss's Avatar
    Join Date
    Mar 2011
    Location
    Belgium
    Posts
    774
    Points
    1,766
         User Info     Contact     Gamer ID
    Join Date
    Mar 2011
    Location
    Belgium
    Posts
    774
    Points
    1,766

    Default

    Cool tutorial, make more tutorials if you can because I really wanne learn more about vb.net

    0 Not allowed! Not allowed!

    ^^ awesome signature made by Demo ^^

  5. #5
    Banned
    Join Date
    Oct 2011
    Posts
    863
    Points
    1,141
         User Info     Contact     Gamer ID
    Join Date
    Oct 2011
    Posts
    863
    Points
    1,141
    Gamer IDs

    Steam ID: buttholemonger

    Contact info:

    Youtube Channel: youtube.com/triixsoldier

    Default [VB.Net] Theme making, MouseStates, what are they, and why use them?

    No problem. I've been working with the language for quite some time. It's good fun.

    0 Not allowed! Not allowed!

  6. #6
    Diehard cheatss's Avatar
    Join Date
    Mar 2011
    Location
    Belgium
    Posts
    774
    Points
    1,766
         User Info     Contact     Gamer ID
    Join Date
    Mar 2011
    Location
    Belgium
    Posts
    774
    Points
    1,766

    Default

    btw are you a member on HF?

    0 Not allowed! Not allowed!

    ^^ awesome signature made by Demo ^^

  7. #7
    Banned
    Join Date
    Oct 2011
    Posts
    863
    Points
    1,141
         User Info     Contact     Gamer ID
    Join Date
    Oct 2011
    Posts
    863
    Points
    1,141
    Gamer IDs

    Steam ID: buttholemonger

    Contact info:

    Youtube Channel: youtube.com/triixsoldier

    Default [VB.Net] Theme making, MouseStates, what are they, and why use them?

    Yes, why?

    0 Not allowed! Not allowed!

  8. #8
    Diehard cheatss's Avatar
    Join Date
    Mar 2011
    Location
    Belgium
    Posts
    774
    Points
    1,766
         User Info     Contact     Gamer ID
    Join Date
    Mar 2011
    Location
    Belgium
    Posts
    774
    Points
    1,766

    Default

    Quote Originally Posted by Skai View Post
    Yes, why?
    I've seen the same tutorial on HF, did you post it?

    0 Not allowed! Not allowed!

    ^^ awesome signature made by Demo ^^

  9. #9
    Banned
    Join Date
    Oct 2011
    Posts
    863
    Points
    1,141
         User Info     Contact     Gamer ID
    Join Date
    Oct 2011
    Posts
    863
    Points
    1,141
    Gamer IDs

    Steam ID: buttholemonger

    Contact info:

    Youtube Channel: youtube.com/triixsoldier

    Default [VB.Net] Theme making, MouseStates, what are they, and why use them?

    Yes, I'm Weary. I can pm and +rep you to remove any doubt.

    0 Not allowed! Not allowed!

  10. #10
    Diehard cheatss's Avatar
    Join Date
    Mar 2011
    Location
    Belgium
    Posts
    774
    Points
    1,766
         User Info     Contact     Gamer ID
    Join Date
    Mar 2011
    Location
    Belgium
    Posts
    774
    Points
    1,766

    Default

    Quote Originally Posted by Skai View Post
    Yes, I'm Weary. I can pm and +rep you to remove any doubt.
    You don't have to, I believe you. ;)

    0 Not allowed! Not allowed!

    ^^ awesome signature made by Demo ^^

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -10. The time now is 10:04 AM.
Powered by vBulletin®
Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.