Thread: Mouse Coordinates on LoginScreen

Results 1 to 4 of 4
  1. #1 Mouse Coordinates on LoginScreen 
    Ex Rune-Scaper

    Join Date
    Jun 2008
    Posts
    3,541
    Thanks given
    457
    Thanks received
    1,259
    Rep Power
    1003
    Trying to move this to the top left of the screen but when I change the position of this it doesn't work.

    It's displaying in the loginbox and I don't want that.


    Code:
    	public int centerX = Constants.clientWidth / 2;
    	public int centerY = Constants.clientHeight / 2;
    
    	private void drawLoginScreen(boolean flag) {
    		resetImageProducers();
    		aRSImageProducer_1109.setCanvas();
    		aBackground_966.drawBackground(0, 0);
    		char c = '\u0168';
    		char c1 = '\310';
    		if (loginScreenState == 0) {
    			int i = c1 / 2 + 80;
    			smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString,
    					i, true);
    			i = c1 / 2 - 20;
    			chatTextDrawingArea.method382(0xffff00, c / 2, "Welcome to "
    					+ Config.clientName, i, true);
    			i += 30;
    			int l = c / 2 - 80;
    			int skillId = c1 / 2 + 20;
    			aBackground_967.drawBackground(l - 73, skillId - 20);
    			chatTextDrawingArea.method382(0xffffff, l, "New User", skillId + 5,
    					true);
    			l = c / 2 + 80;
    			aBackground_967.drawBackground(l - 73, skillId - 20);
    			chatTextDrawingArea.method382(0xffffff, l, "Existing User",
    					skillId + 5, true);
    		}
    		if (loginScreenState == 2) {
    			int j = c1 / 2 - 40;
    			if (loginMessage1.length() > 0) {
    				chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage1,
    						j - 15, true);
    				chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2,
    						j, true);
    				j += 30;
    			} else {
    				chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2,
    						j - 7, true);
    				j += 30;
    			}
    			chatTextDrawingArea
    					.method389(true, c / 2 - 90, 0xffffff, "Username: "
    							+ myUsername
    							+ ((loginScreenCursorPos == 0)
    									& (loopCycle % 40 < 20) ? "@[email protected]|" : ""), j);
    			j += 15;
    			chatTextDrawingArea
    					.method389(true, c / 2 - 88, 0xffffff, "Password: "
    							+ TextClass.passwordAsterisks(myPassword)
    							+ ((loginScreenCursorPos == 1)
    									& (loopCycle % 40 < 20) ? "@[email protected]|" : ""), j);
    			j += 15;
    			if (!flag) {
    				int i1 = c / 2 - 80;
    				int l1 = c1 / 2 + 50;
    				aBackground_967.drawBackground(i1 - 73, l1 - 20);
    				chatTextDrawingArea.method382(0xffffff, i1, "Login", l1 + 5,
    						true);
    				i1 = c / 2 + 80;
    				aBackground_967.drawBackground(i1 - 73, l1 - 20);
    				chatTextDrawingArea.method382(0xffffff, i1, "Cancel", l1 + 5,
    						true);
    			}
    		}
    		if (loginScreenState == 3) {
    			chatTextDrawingArea.method382(0xffff00, c / 2,
    					"Create a free account", c1 / 2 - 60, true);
    			int k = c1 / 2 - 35;
    			chatTextDrawingArea.method382(0xffffff, c / 2,
    					"To create a new account you need to", k, true);
    			k += 15;
    			chatTextDrawingArea.method382(0xffffff, c / 2,
    					"go back to the main " + Config.clientName + " webpage", k,
    					true);
    			k += 15;
    			chatTextDrawingArea.method382(0xffffff, c / 2,
    					"and choose the red 'create account'", k, true);
    			k += 15;
    			chatTextDrawingArea.method382(0xffffff, c / 2,
    					"button at the top right of that page.", k, true);
    			k += 15;
    			int j1 = c / 2;
    			int i2 = c1 / 2 + 50;
    			aBackground_967.drawBackground(j1 - 73, i2 - 20);
    			chatTextDrawingArea.method382(0xffffff, j1, "Cancel", i2 + 5, true);
    		}
    		if (Config.debug) {
    			boldFont.method382(0xffffff, centerX - 320, "Mouse: " + (mouseX - centerX) + "," + (mouseY - centerY), centerY - 200, true);
    		}
    		aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
    		if (welcomeScreenRaised) {
    			welcomeScreenRaised = false;
    			aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
    			aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
    			aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
    			aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
    			aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
    			aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
    		}
    	}
    Reply With Quote  
     

  2. #2  
    Community Veteran

    Songoty's Avatar
    Join Date
    Dec 2007
    Posts
    2,741
    Thanks given
    207
    Thanks received
    1,022
    Rep Power
    2351
    it's because the login screen uses multiple image producers to draw the login screen. the flames are their own, so is the login box etc. that method is just drawing the login box using the loginbox image producers (1109). you will either have to redo the image producers for the login screen to just be one instead of multiple, or draw it somewhere else.
    Reply With Quote  
     

  3. #3  
    Ex Rune-Scaper

    Join Date
    Jun 2008
    Posts
    3,541
    Thanks given
    457
    Thanks received
    1,259
    Rep Power
    1003
    Quote Originally Posted by Songoty View Post
    it's because the login screen uses multiple image producers to draw the login screen. the flames are their own, so is the login box etc. that method is just drawing the login box using the loginbox image producers (1109). you will either have to redo the image producers for the login screen to just be one instead of multiple, or draw it somewhere else.
    Alright thank you, are there any other methods that will allow me to draw it where I want it?
    Reply With Quote  
     

  4. #4  
    Community Veteran

    Songoty's Avatar
    Join Date
    Dec 2007
    Posts
    2,741
    Thanks given
    207
    Thanks received
    1,022
    Rep Power
    2351
    Quote Originally Posted by Sunny++ View Post
    Alright thank you, are there any other methods that will allow me to draw it where I want it?
    not any that are called constantly. the background only draws as required, so if you put it over top of that it would not be updating properly.

    i believe there are tutorials out there on how to change the image producers around. if not, take a look one from one of my old clients.

    Code:
        private void drawLoginScreen(boolean flag) {
            resetImageProducers();
            aRSImageProducer_1109.initDrawingArea();
            int c = myWidth;
            int c1 = myHeight;
            if (!fullscreen) {
                if (loginScreenRefreshRequired) {
                    DrawingArea.fillRectangle(0, 0, myHeight, myWidth, 0);
                    titlescreenBackground.drawSprite(0, 0);
                    loginScreenRefreshRequired = false;
                }
            } else {
                DrawingArea.fillRectangle(0, 0, myHeight, myWidth, 0);
            }
            try {
                loginBox.method361(((c / 2) - loginBox.myWidth) + 180, ((c1 / 2) - loginBox.myHeight) + 110);
            } catch (Exception e) {
                e.printStackTrace();
                System.out.println("C=" + c + " c1=" + c1);
            }
            int j = c1 / 2 - 40;
            if (loginMessage1.length() > 0) {
                chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
                chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j, true);
                j += 30;
            } else {
                chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
                j += 30;
            }
            chatTextDrawingArea.method389(true, c / 2 - 90, 0xffffff, "Username: " + myUsername + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@[email protected]|" : ""), j);
            j += 15;
            chatTextDrawingArea.method389(true, c / 2 - 88, 0xffffff, "Password: " + GameTextUtilities.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@[email protected]|" : ""), j);
            j += 15;
            if (!flag) {
                int i1 = c / 2 - 80;
                int l1 = c1 / 2 + 50;
                loginButton.method361(i1 - 73, l1 - 20);
                chatTextDrawingArea.method382(0xffffff, i1, "Login", l1 + 5, true);
            }
            aRSImageProducer_1109.drawGraphics(0, super.graphics, 0);
        }
    Code:
        void drawLoadingBar(String message, int percent) {
            loadingErrorPercent = percent;
            loadingErrorString = message;
            resetImageProducers();
            if (titleScreenArchive == null) {
                super.drawLoadingBar(message, percent);
                return;
            }
            aRSImageProducer_1109.initDrawingArea();
            int c = myWidth;
            int c1 = myHeight + 33;
            byte byte1 = 20;
            int j = myHeight / 2 - 18;
            if (titlescreenBackground != null) {
                if (backgroundRedraw) {
                    if (!fullscreen) {
                        titlescreenBackground.drawSprite(0, 0);
                        backgroundRedraw = false;
                    } else {
                        DrawingArea.fillRectangle(0, 0, myHeight, myWidth, 0);
                        backgroundRedraw = false;
                    }
                }
            }
            DrawingArea.drawRectangle(c / 2 - 152, 304, 34, 0x006699, j);
            DrawingArea.drawRectangle(c / 2 - 151, 302, 32, 0, j + 1);
            DrawingArea.fillRectangle(j + 2, c / 2 - 150, 30, percent * 3, 0x006699);
            DrawingArea.fillRectangle(j + 2, (c / 2 - 150) + percent * 3, 30, 300 - percent * 3, 0);
            chatTextDrawingArea.drawText(0xffffff, message, (c1 / 2 + 5) - byte1, c / 2);
            aRSImageProducer_1109.drawGraphics(0, super.graphics, 0);
        }
    Code:
        private void resetImageProducers2() {
            nullLoader();
            super.fullGameScreen = null;
            aRSImageProducer_1107 = new RSImageProducer(509, 171, getGameComponent());
            DrawingArea.setAllPixelsToZero();
            aRSImageProducer_1109 = new RSImageProducer(myWidth, myHeight, getGameComponent());
            DrawingArea.setAllPixelsToZero();
            aRSImageProducer_1165 = new RSImageProducer(myWidth, myHeight, getGameComponent());
            DrawingArea.setAllPixelsToZero();
        }
    
        private void resetImageProducers() {
            if (aRSImageProducer_1107 != null) {
                return;
            }
            super.fullGameScreen = null;
            aRSImageProducer_1165 = null;
            aRSImageProducer_1107 = new RSImageProducer(509, 171, getGameComponent());
            DrawingArea.setAllPixelsToZero();
            aRSImageProducer_1109 = new RSImageProducer(myWidth, myHeight, getGameComponent());
            DrawingArea.setAllPixelsToZero();
        }
    Reply With Quote  
     


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. Mouse Cords on Custom Loginscreen
    By Reich in forum Snippets
    Replies: 5
    Last Post: 06-05-2012, 10:58 PM
  2. Mouse Coordinates
    By Clouds Mine in forum Requests
    Replies: 2
    Last Post: 09-22-2009, 05:53 PM
  3. Player + Mouse Coordinates
    By Riedell in forum Snippets
    Replies: 11
    Last Post: 04-17-2009, 06:36 PM
  4. Mouse Coordinates
    By Microsoft in forum Requests
    Replies: 6
    Last Post: 03-07-2009, 06:30 PM
  5. Showing sprite (mouse coordinate)
    By BenjaR in forum Help
    Replies: 5
    Last Post: 03-07-2009, 06:19 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •