마인크래프트 서버 접속기 만들기[3]

2013. 3. 30. 17:26·Game/Minecraft
반응형


   안녕하세요. 말똥이입니다.



2013/03/30 - [마인크래프트/개발] - 마인크래프트 서버 접속기 만들기[1]


2013/03/30 - [마인크래프트/개발] - 마인크래프트 서버 접속기 만들기[2]



 이번에는 저번 글에 이어

버튼의 위치와 크기를 바꿔보겠습니다.




저 다시접속버튼대신 메인메뉴버튼과 다시접속을 둘다 만들어보는겁니다.

ㄱㄱ



버튼에 대해 알려면 GuiButton.java에 들어가보면 됩니다.


    public GuiButton(int par1, int par2, int par3, int par4, int par5, String par6Str)

    {

        this.width = 200;

        this.height = 20;

        this.enabled = true;

        this.drawButton = true;

        this.id = par1;

        this.xPosition = par2;

        this.yPosition = par3;

        this.width = par4;

        this.height = par5;

        this.displayString = par6Str;

    }


이렇게 구성되어있네요.


첫번째의 this.width는 this.width의 기본값설정

두번째 this.height도 기본값설정..

3번째는.. 글세요. 저것도 기본값인데..


어쨌든


        this.width = 200;

        this.height = 20;

        this.enabled = true;

        this.drawButton = true;


예네 모두가 기본값입니다.

그아래부터


        this.id = par1;


이건 고유번호


        this.xPosition = par2;

        this.yPosition = par3;


이건 위치(좌표)



        this.width = par4;

        this.height = par5;


이건 크기


        this.displayString = par6Str;


이건 뜨는 내용입니다.


위치를 바꿀거니까 두번째를 수정해야겠네요.


아까 GuiDisconnected.java에서 


        this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, "다시 접속")); 아래에


        this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, "메인 메뉴로"));



를 추가해주세요.


그리고 

    protected void actionPerformed(GuiButton par1GuiButton)

    {

        if (par1GuiButton.id == 0)

        {

            //this.mc.displayGuiScreen(this.field_98095_n);

        //this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, new ServerData("계피서버", "mc.ryush00.com")));

        this.mc.displayGuiScreen(new GuiMainMenu());

        }

    }



예를


    protected void actionPerformed(GuiButton par1GuiButton)

    {

        if (par1GuiButton.id == 0)

        {

            //this.mc.displayGuiScreen(this.field_98095_n);

        //this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, new ServerData("계피서버", "mc.ryush00.com")));

        this.mc.displayGuiScreen(new GuiMainMenu());

        }

        if (par1GuiButton.id == 1)

        {

        this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, new ServerData("서버이름", "서버주소")));

        }

    }

이걸 추가해주세요.




그런데 지금 현재는 두 버튼의 위치가 같죠?

실행하면 겹칠게 뻔하죠..


높이를 바꾸려면 par3을 수정해주면 되겠죠?


3번째네요.


this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, "메인 메뉴로"));


이곳을 바꾸면 됩니다. 여기서 어떻게든 노가다하든 어떻게하든 위치를 수정해보면



        this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, "메인 메뉴로"));

        this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 - 12 , "다시 접속"));


+- 차이네요..

이렇게 됩니다.





우왕 굳


To Be Contine




*1.5.2는 너무 오래되었을 뿐더러, 질문하셔도 답변해 드리기 어렵습니다. 개인적 일기라 생각하여 주세요.

반응형
저작자표시 비영리 동일조건 (새창열림)
'Game/Minecraft' 카테고리의 다른 글
  • 마인크래프트 서버 접속기 만들기[5]
  • 마인크래프트 서버 접속기 만들기[4]
  • 마인크래프트 서버 접속기 만들기[2]
  • 마인크래프트 서버 접속기 만들기[1]
ryush00
ryush00
IT 관련 글이 올라와요
    반응형
  • ryush00
    말똥이의 블로그
    ryush00
  • 전체
    오늘
    어제
    • 모든 글 (225)
      • 블로그 (13)
        • 공지 사항 (5)
        • 블로그 운영 팁 (6)
        • 기타 (2)
      • IT (69)
        • 정보글 (51)
        • 리뷰 (8)
        • 심층 분석 (5)
        • NAS (5)
      • Game (44)
        • Minecraft (40)
        • 게임 정보글 (4)
      • Dev (53)
        • PHP (1)
        • HTML & CSS (0)
        • Ruby (3)
        • DB (2)
        • 클라우드 (2)
        • 행사 (0)
        • 삽질 방지 (20)
      • 마인리스트 (10)
      • 이모저모 (21)
        • 나의 생각 (7)
        • 나의 일상 (4)
        • 유용한 것들 (3)
        • 노하우 (6)
      • 휴지통 (0)
      • 안전 (0)
        • 베리어프리 (0)
        • 교통 안전 (0)
  • 블로그 메뉴

    • 전체글
    • 공지사항
  • 링크

    • 마인리스트
  • 공지사항

    • 저작권 안내
  • 인기 글

  • 태그

    해킹
    bukkit
    php
    apk
    Ruby on Rails
    아이폰
    티스토리
    토렌트
    구글 지도 반출
    안드로이드
    spigot
    java
    ruby
    삽질
    시놀로지
    마인크래프트
    블로그
    MySQL
    티스토리 초대장
    맥
    오류
    구글 지도
    CloudFlare
    마인리스트
    개발
    클라우드플레어
    howto
    문제해결
    애플
    NAS
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.0
ryush00
마인크래프트 서버 접속기 만들기[3]
상단으로

티스토리툴바