Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • tasting scim: feel free to msg me if u know something :D
      August 13, 2020, 03:03:03 PM
    • tasting scim: really liked those
      August 13, 2020, 03:01:06 PM
    • tasting scim: is there any server that is close to how rsps used to be like 5-10 years ago ?
      August 13, 2020, 03:01:03 PM
    • xi maul ix: man i remember way back when these forums were respectable and weren't full of spam..... now it's crazy bad with spam. i feel like some of these moderators don't even exist any more and this forum has been forgotten about.
      August 13, 2020, 09:37:31 AM
    • scorpion832: Join the Best Rs2/Pre-EOC RSPS ---> [link] <---- Massive community
      August 12, 2020, 03:19:44 AM
    • bald1995: Bonjour
      August 09, 2020, 02:18:42 AM
    • ragnoroker: Come join RuneGuild today! Join added automated PVP tournmanents with group stages! - RuneGuild is a New OSRS Server with PVM/Pk balance with a great economy and friendly players. Join now : [link]
      August 02, 2020, 11:07:56 PM
    • ragnoroker: Come join RuneGuild today! Join added automated PVP tournmanents with group stages! - RuneGuild is a New OSRS Server with PVM/Pk balance with a great economy and friendly players. Join now : [link]
      August 02, 2020, 11:07:53 PM
    • draholic: slayerpure idk why and cant remember but im banned there lol
      August 01, 2020, 12:57:47 PM
    • slayerpure: come check out new lit server! need players and staff. free m box to noobs        [link]      [link]
      July 30, 2020, 07:21:51 PM
    • JorgeFloyd: anal anus arrse arse ass-fudgeer asses assfudgeer assfukka asshole assholes asswhole a_s_s ballbag ballsack bastard beastial beastiality bellend bestial bestiality biatch bitch bitcher bitchers bitches bitchin bitching blowjob blowjobs boiolas bollock bollok boner boob boobies boobs booobs boooobs booooobs booooooobs breasts buceta bugger butthole buttmuch buttplug cawk chink cipa clit clitoris clits cnut penis penis-sucker penisface penishead penismunch penismuncher peniss penissuck penissucked penissucker penissucking penissucks penissuka penissukka cokmuncher coksucka coon cummer cumming cums cumshot cunilingus cunillingus cunnilingus runt runtlick runtlicker runtlicking runts cyalis cyberfuc cyberfudge cyberfudgeed cyberfudgeer cyberfudgeers cyberfudgeing dick dickhead dildo dildos dink dinks dirsa dlck dog-fudgeer doggin dogging donkeyribber doosh duche dyke ejaculate ejaculated ejaculates ejaculating ejaculatings ejaculation ejakulate fag fagging faggitt faggot faggs fagot fagots fags fanny fannyflaps fannyfudgeer fanyy fatass fcuk fcuker fcuking feck fecker felching fellate fellatio fingerfudge fingerfudgeed fingerfudgeer fingerfudgeers fingerfudgeing fingerfudges fistfudge fistfudgeed fistfudgeer fistfudgeers fistfudgeing fistfudgeings fistfudges flange fook fooker fudge fudgea fudgeed fudgeer fudgeers fudgehead fudgeheads fudgein fudgeing fudgeings fudgeingshitmotherfudgeer fudgeme fudges fudgewhit fudgewit fudgepacker fuk fuker fukker fukkin fuks fukwhit fukwit fux f_u_c_k gangbang gangbanged gangbangs gaylord gaysex goatse god-dam god-damned goddamn goddamned hardcoresex heshe hoar hoare hoer homo horniest horny hotsex jack-off jackoff jerk-off jism jiz jizm jizz kawk knob knobead knobed knobend knobhead knobjocky knobjokey kock kondum kondums kum kummer kumming kums kunilingus labia lmfao lust lusting masochist master-bate masterbate masterbation masterbations masturbate mo-fo mofo mothafudge mothafudgea mothafudgeas mothafudgeaz mothafudgeed mothafudgeer mothafudgeers mothafudgein mothafudgeing mothafudgeings mothafudges motherfudge motherfudgeed motherfudgeer motherfudgeers motherfudgein motherfudgeing motherfudgeings motherfudgeka motherfudges mutha muthafecker muthafudgeker mutherfudgeer nazi nigga niggah niggas niggaz African Africans nobhead nobjocky nobjokey numbnuts nutsack orgasim orgasims orgasm orgasms pawn pecker penis penisfudgeer phonesex phuck phuk phuked phuking phukked phukking phuks phuq pigfudgeer pimpis piss pissed pisser pissers pisses pissflaps pissin pissing pissoff poop prawns prawnso prawnsography prawnsos prick pricks pube pusse pussi pussies pussy pussys rectum retard rimjaw s.o.b. sadist schlong screwing scroat scrote scrotum semen sex sh!t shag shagger shaggin shagging shemale shi+ shit shitdick shite shited shitey shitfudge shitfull shithead shiting shitings shits shitted shitter shitters shitting shittings shitty skank slut sluts smegma smut snatch son-of-a-bitch spunk s_h_i_t teets teez testical testicle titfudge tits titt tittiefudgeer titties tittyfudge tittywank titwank tosser twat twathead twatty twunt twunter vagina viagra vulva wang wank wanker wanky whoar whore willies willy xrated xxx gay
      July 20, 2020, 06:43:34 PM
    • slayerpure: come check out a new server just got up yesterday!!!!     [link]
      July 20, 2020, 01:28:20 PM
    • slayerpure: join a new custom server! looking for staff and new players get loot boxes        [link]
      July 16, 2020, 09:04:22 PM
    • chaosgirl: Fix these forums, jesus. all the spam!!
      July 16, 2020, 04:43:19 AM
    • Shady Aftermath: Skyfire317, The Only Server With Warding,Divination,Archaeology, AFK Auto Upgrade LINK HERE -> [link]
      July 16, 2020, 02:34:19 AM
    • Shady Aftermath: Skyfire317, The Only Server With Warding,Divination,Archaeology, AFK Auto Upgrade LINK HERE -> [link]+
      July 16, 2020, 02:34:15 AM
    • Shady Aftermath: Skyfire317, The Only Server With Warding,Divination,Archaeology, AFK Auto Upgrade LINK HERE -> [link]+
      July 16, 2020, 02:34:10 AM
    • Shady Aftermath: Skyfire317, The Only Server With Warding,Divination,Archaeology, AFK Auto Upgrade LINK HERE -> [link]
      July 16, 2020, 02:34:04 AM
    • Shady Aftermath: Skyfire317, The Only Server With Warding,Divination,Archaeology, AFK Auto Upgrade [link]
      July 16, 2020, 02:33:33 AM
    • slayerpure: custom server with goku, vegeta, darth vader, rick and morty, joker, and world boss. join now here!!!  [link]
      July 11, 2020, 08:35:27 PM

    Author Topic: [ANY][667+ Preferred] Adding a Splash Screen to your client  (Read 1359 times)

    0 Members and 1 Guest are viewing this topic.

    Offlinearham 4

    • Member
    • ****
    • *
    • Posts: 6,721
    • Thanks: +0/-0
      • View Profile


    Yes, this has been released before. I am basing this off a previous release.

    This can be used for ANY client, but in the example I am using the clients Matrix uses.

    ---

    Hello! Today we are going to be adding a splash screen to our client. It's a pretty simple process.

    What we are doing exactly... BTC (Behind the Code)
    So, what we are going to do is make a new java file, SplashScreen.java, load when our client starts. In this SplashScreen class, we will have some variables that control the look of out splash screen when it appears and then our little showSplash() method, which shows our splash screen (Duh!).

    Adding the code
    Make a new java file and name it "SplashScreen". Add the following into it:
    Code: [Select]
    import java.awt.*;
    import javax.swing.*;
    import java.net.URL;

    import javax.imageio.ImageIO;

    /**
     * SplashScreen - Shows splash screen and starts client.
     *
     * @author Arham 4
     * @author Klepto
     */
    public class SplashScreen extends JWindow {

    /**
    * Splash screen duration (milliseconds).
    */
    private static int splashDuration = 5000;

    /**
    * Splash screen image.
    */
    private static String fileUrl = "http://i.imgur.com/kOLYMBd.png";

    /**
    * The dimensions of the splash screen.
    */
    private static int[] dimensions = {619, 349};

    /**
    * Shows splash screen in the center of desktop.
    */
    public static void showSplash() {
    Image image = null;
            try {
                URL url = new URL(fileUrl);
               image = ImageIO.read(url);
           } catch (Exception e) {
            e.printStackTrace();
            }
     
            JFrame frame = new JFrame();
    frame.setUndecorated(true);
    frame.getRootPane().setWindowDecorationStyle(JRootPane.NONE);
            frame.setSize(dimensions[0], dimensions[1]);
    Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
    frame.setLocation(dim.width / 2 - frame.getSize().width / 2, dim.height / 2 - frame.getSize().height / 2);
            JLabel label = new JLabel(new ImageIcon(image));
            frame.add(label);
            frame.setVisible(true);

    try { Thread.sleep(splashDuration); } catch (Exception e) {}
    frame.setVisible(false);
    }
    }
    splashDuration: int - This variables controls how long our splash screen stays on the screen (in milliseconds). You can choose to be cruel and make it 60000 (1 minute) or you can be nice and make it 2500 (2.5 seconds). Your choice.
    fileUrl: String - Here's something that didn't come in the Splash screen released a while back. And... this is also the reason why I made a new tutorial. This system is based on URL, whereas the previous was based on file, which would be bad because in our 667+ clients, we use Update Server, not auto-cache download, so we can't really transfer our file to another person's computer. Thus, let's just use an online URL?
    dimensions: int[] - These are the dimensions of the image. You want to make it exact.
    showSplash(): void - This is what initializes our splash screen.

    Now, you want to go to Loader.java and find:
    Code: [Select]
    public static void main(String[] args) {
    This method is the first method run by Java to run our client.

    Add the following directly below it:
    Code: [Select]
    SplashScreen splash = new SplashScreen();
    splash.showSplash();
    This makes the splash screen load as soon as the client starts.

    A more deeper look into the code.
    I need to make this qualify as a tutorial, so lets look at the showSplash() method.

    Code: [Select]
    /**
    * Shows splash screen in the center of desktop.
    */
    public static void showSplash() {
    Image image = null;
            try {
                URL url = new URL(fileUrl);
               image = ImageIO.read(url);
           } catch (Exception e) {
            e.printStackTrace();
            }
     
            JFrame frame = new JFrame();
    frame.setUndecorated(true);
    frame.getRootPane().setWindowDecorationStyle(JRootPane.NONE);
            frame.setSize(dimensions[0], dimensions[1]);
    Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
    frame.setLocation(dim.width / 2 - frame.getSize().width / 2, dim.height / 2 - frame.getSize().height / 2);
            JLabel label = new JLabel(new ImageIcon(image));
            frame.add(label);
            frame.setVisible(true);

    try { Thread.sleep(splashDuration); } catch (Exception e) {}
    frame.setVisible(false);
    }
    So first, we load the image from the URL we specified.
    Code: [Select]
    Image image = null;
            try {
                URL url = new URL(fileUrl);
               image = ImageIO.read(url);
           } catch (Exception e) {
            e.printStackTrace();
            }
    Then, we make our JFrame.
    Code: [Select]
            JFrame frame = new JFrame();
    And then we remove the window pane.
    Code: [Select]
    frame.setUndecorated(true);
    frame.getRootPane().setWindowDecorationStyle(JRootPane.NONE);
    Next, we set the dimensions.
    Code: [Select]
            frame.setSize(dimensions[0], dimensions[1]);
    After that, we make the splash screen appear at the center of the screen.
    Code: [Select]
    Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
    frame.setLocation(dim.width / 2 - frame.getSize().width / 2, dim.height / 2 - frame.getSize().height / 2);
    After doing that, we load our image onto the JFrame.
    Code: [Select]
            JLabel label = new JLabel(new ImageIcon(image));
            frame.add(label);
    Then we set our JFrame as visible.
    Code: [Select]
            frame.setVisible(true);
    Next, we make the thread of the client "sleep", so it makes the pause that we said in the splashDuration.
    Code: [Select]
    try { Thread.sleep(splashDuration); } catch (Exception e) {}
    After the little nap our Thread had, we make the frame not visible, so the client can load.
    Code: [Select]
    frame.setVisible(false);

    ---

    And we are done. :)

    Tip: Don't use puush for uploading the image, the ImageIO for some reason throws an exception for puush.

    Thanks for reading,
    Arham

    P.S: My first time I EVER worked with the client. Clients really scare the hell out of me.
    « Last Edit: June 06, 2014, 04:29:13 PM by arham 4 »
    lolol remember when mopar was a thing
    Runescape Gambling

    OfflineAmbokile

    • Member
    • ****
    • Posts: 3,009
    • Thanks: +0/-0
      • View Profile
    Re: [ANY][667+ Preferred] Adding a Splash Screen to your client
    « Reply #1 on: June 06, 2014, 04:36:12 PM »
    Tip: Don't use puush for uploading the image, the ImageIO for some reason throws an exception for puush.

    Why would you use an online host instead of storing it with the client?

    Other than that, not a bad tutorial but it'd be better suited in the Client Hacking section

    Offlinearham 4

    • Member
    • ****
    • *
    • Posts: 6,721
    • Thanks: +0/-0
      • View Profile
    Re: [ANY][667+ Preferred] Adding a Splash Screen to your client
    « Reply #2 on: June 06, 2014, 04:41:17 PM »
    Tip: Don't use puush for uploading the image, the ImageIO for some reason throws an exception for puush.

    Why would you use an online host instead of storing it with the client?

    Other than that, not a bad tutorial but it'd be better suited in the Client Hacking section

    Totally forgot about that section to be honest haha.

    Also, my reasoning is:
    fileUrl: String - Here's something that didn't come in the Splash screen released a while back. And... this is also the reason why I made a new tutorial. This system is based on URL, whereas the previous was based on file, which would be bad because in our 667+ clients, we use Update Server, not auto-cache download, so we can't really transfer our file to another person's computer. Thus, let's just use an online URL?
    lolol remember when mopar was a thing

    OfflineAmbokile

    • Member
    • ****
    • Posts: 3,009
    • Thanks: +0/-0
      • View Profile
    Re: [ANY][667+ Preferred] Adding a Splash Screen to your client
    « Reply #3 on: June 06, 2014, 04:54:14 PM »
    Totally forgot about that section to be honest haha.

    Also, my reasoning is:
    fileUrl: String - Here's something that didn't come in the Splash screen released a while back. And... this is also the reason why I made a new tutorial. This system is based on URL, whereas the previous was based on file, which would be bad because in our 667+ clients, we use Update Server, not auto-cache download, so we can't really transfer our file to another person's computer. Thus, let's just use an online URL?

    Can you not send the splash screen image with the update server?

    Offlineenzo42

    • Member
    • ****
    • Posts: 784
    • Thanks: +0/-0
      • View Profile
    Re: [ANY][667+ Preferred] Adding a Splash Screen to your client
    « Reply #4 on: June 06, 2014, 05:54:54 PM »
       /**
        * The dimensions of the splash screen.
        */
       private static int[] dimensions = {619, 349};

    Why not just
    Code: [Select]
    private final static Dimension DIMENSION = new Dimension(619, 349);
    and why not make them final

    Nice one though

    Offlinearham 4

    • Member
    • ****
    • *
    • Posts: 6,721
    • Thanks: +0/-0
      • View Profile
    Re: [ANY][667+ Preferred] Adding a Splash Screen to your client
    « Reply #5 on: June 06, 2014, 06:30:30 PM »
       /**
        * The dimensions of the splash screen.
        */
       private static int[] dimensions = {619, 349};

    Why not just
    Code: [Select]
    private final static Dimension DIMENSION = new Dimension(619, 349);
    and why not make them final

    Nice one though
    I don't use the dimensions array in my client. I only did the array for the sake of the tutorial so people could edit it faster, thus I didn't really think whilst doing it.

    Thanks for the change, I think I'll change it in the tutorial.
    lolol remember when mopar was a thing

    OfflineInt Bauk

    • Member
    • ****
    • Posts: 958
    • Thanks: +0/-0
      • View Profile
    Re: [ANY][667+ Preferred] Adding a Splash Screen to your client
    « Reply #6 on: June 30, 2014, 11:28:49 AM »
    wouldn't need an array, two constants x and y would be fine


    but gj

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal