Thread: Simple fade into login components

Page 1 of 3 123 LastLast
Results 1 to 10 of 26
  1. #1 Simple fade into login components 
    Rune-Server Affiliate

    Join Date
    Apr 2014
    Posts
    1,761
    Thanks given
    75
    Thanks received
    714
    Rep Power
    1073
    So I saw a guy post a help thread, asking if anyone knew how to do this. So I decided to post this snippet in case other people would like to as well!

    What you're adding:


    Let's create a variable to store the fade value:

    Code:
    private int fadeValue = 0;
    Then, in method #drawLoginScreen under where it initializes the login screen canvas add:
    Code:
    if (fadeValue < 255) {
    			fadeValue += 5;
    		}
    (feel free to change up the speed of the fade)

    Once you've done that, just under where you put that code, add your background loading code, and add the alpha value "fadeValue" should look something like this:
    Code:
    loginBackground.drawAdvancedSprite(0, 0, fadeValue);
    Lastly, you're going to wrap your login screen component's code (EXCEPT THE BACKGROUND DRAWING!) in with:

    Code:
    if (fadeValue >= 255) {
    ...
    }
    And if you really cannot follow this snippet, Use this to reference.. as to what it should all look like:
    Spoiler for Reference:
    Code:
    private int fadeValue = 0;
    	public void drawLoginScreen() {
    		resetImageProducers();
    		titleScreen.initDrawingArea();
    		if (fadeValue < 255) {
    			fadeValue += 5;
    		}
    		loginBackground.drawAdvancedSprite(0, 0, fadeValue);
    		if (fadeValue >= 255) {
    			loginBox.drawAdvancedSprite((765 - 368) / 2, 131);
    			setLoadingAndLoginHovers();
    			if (loginMessages[0].length() > 0) {
    				for (int i = 0; i < loginMessages.length; i++) {
    					if(i >= 1) {
    						break;
    					}
    					String s = loginMessages[i];
    					if (s == null || s.length() == 0) {
    						continue;
    					}
    					int y = 102 + (i * 20)+65;
    					boldFont.drawRegularText(true, (765 - boldFont.getTextWidth(s)) / 2, 0xD8BCA0, s, y);
    				}
    			}
    			if (loginButtonHover) {
    				loginHover.drawAdvancedSprite(257, 356);
    			}
    			if (loginScreenCursorPos == 0 && loopCycle % 45 < 10) {
    				boldFont.drawRegularText(true, 265, 0xD8BCA0, myUsername + "|", 216);
    			} else {
    				boldFont.drawRegularText(true, 265, 0xD8BCA0, myUsername, 216);
    			}
    			if (loginScreenCursorPos == 1 && loopCycle % 45 < 10) {
    				boldFont.drawRegularText(true, 265, 0xD8BCA0, getStars(myPassword) + "|", 269);
    			} else {
    				boldFont.drawRegularText(true, 265, 0xD8BCA0, getStars(myPassword), 269);
    			}
    			if (rememberMe) {
    				DrawingArea.drawDiagonalLine(259, 283, 268, 292, 0xFFFFFF);
    				DrawingArea.drawDiagonalLine(259, 292, 268, 283, 0xFFFFFF);
    			}
    		}
    		titleScreen.drawGraphics(0, super.graphics, 0);
    	}
    Reply With Quote  
     


  2. #2  
    Donator


    Join Date
    Aug 2013
    Posts
    610
    Thanks given
    288
    Thanks received
    123
    Rep Power
    162
    GJ Son
    Reply With Quote  
     

  3. #3  
    Registered Member
    Vippy's Avatar
    Join Date
    Oct 2014
    Age
    25
    Posts
    2,572
    Thanks given
    984
    Thanks received
    1,933
    Rep Power
    5000
    Looks smooth nice job
    Reply With Quote  
     

  4. #4  
    WVWVWVWVWVWVWVW

    _jordan's Avatar
    Join Date
    Nov 2012
    Posts
    3,046
    Thanks given
    111
    Thanks received
    1,848
    Rep Power
    5000
    looks cool
    Attached image
    Attached image
    Reply With Quote  
     

  5. #5  
    Registered Member
    Zivik's Avatar
    Join Date
    Oct 2007
    Age
    28
    Posts
    4,421
    Thanks given
    891
    Thanks received
    1,527
    Rep Power
    3285
    Thanks for the share.
    Reply With Quote  
     

  6. #6  
    Extreme Donator

    Kiana's Avatar
    Join Date
    May 2015
    Posts
    1,050
    Thanks given
    147
    Thanks received
    187
    Rep Power
    223
    Nice one man thanks.
    Reply With Quote  
     

  7. #7  
    Rune-Server Affiliate

    Join Date
    Apr 2014
    Posts
    1,761
    Thanks given
    75
    Thanks received
    714
    Rep Power
    1073
    no problem
    Reply With Quote  
     

  8. #8  
    Banned

    Join Date
    May 2016
    Age
    55
    Posts
    1,137
    Thanks given
    565
    Thanks received
    600
    Rep Power
    0
    nice basically same as ruthless's
    Reply With Quote  
     

  9. #9  
    Rune-Server Affiliate

    Join Date
    Apr 2014
    Posts
    1,761
    Thanks given
    75
    Thanks received
    714
    Rep Power
    1073
    Quote Originally Posted by Ruthless View Post
    nice basically same as ruthless's
    Haha nice
    Reply With Quote  
     

  10. #10  
    Registered Member Stevenhax's Avatar
    Join Date
    Jul 2014
    Posts
    387
    Thanks given
    55
    Thanks received
    64
    Rep Power
    42
    Looks great, would've used if my client didn't already have it.
    Reply With Quote  
     

Page 1 of 3 123 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Simple register and login shizzle
    By Sub in forum Website Development
    Replies: 6
    Last Post: 05-23-2010, 08:08 AM
  2. [VB: 05-08] Visual Basic Simple Login System
    By HyreScape in forum Application Development
    Replies: 7
    Last Post: 05-15-2010, 12:59 AM
  3. simple login system
    By Light Moger in forum Application Development
    Replies: 5
    Last Post: 03-11-2009, 10:10 PM
  4. Simple First Login and Role Set Bases
    By Dexter Morgan in forum Tutorials
    Replies: 4
    Last Post: 11-27-2008, 07:26 AM
  5. How to reduce login lag (Simple)
    By Killer 99 in forum Tutorials
    Replies: 8
    Last Post: 04-08-2008, 12:18 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •