조회 수 544 추천 수 0 댓글 1
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

rpg_scene.js 파일을 살펴보시면

 

타이틀 화면을 보여주는 함수를 살펴보실 수 있습니다.


Scene_Title.prototype.start = function() {
 Scene_Base.prototype.start.call(this);
 SceneManager.clearStack();
 this.centerSprite(this._backSprite1);
 this.centerSprite(this._backSprite2);
 this.playTitleMusic();
 this.startFadeIn(this.fadeSpeed(), false);
};

 

여기에서 전체적인 흐름을 살펴보실 수 있습니다.

 

 

우선은 해당 함수 스스로를 실행하는 부분이 있습니다.

 

Scene_Base.prototype.start.call(this);

 

 

다음으로는 SceneManager가 화면에 그리는 그리는

 

목록을 비우는 부분이 있습니다.


SceneManager.clearStack = function() {
 this._stack = [];
};

 

 

이후에 배경 스트라이프 2개를 중앙에 그립니다.


this.centerSprite(this._backSprite1);
this.centerSprite(this._backSprite2);

 

 

스트라이프를 그려준 뒤에 음악을 재생하고

 

this.playTitleMusic();

 

 

드디어 fade-in 효과를 연출합니다.

 

this.startFadeIn(this.fadeSpeed(), false)

 

 

기본적으로 살펴보셨다면 이제는 본론으로

 

들어가서 전에 올리신 글의 댓글에 fade-in의

 

색상을 변경하고 추가한 스크립트를

 

작성하셨음에도 원하시는 대로 되지 않았던

 

이유에 대해서 설명해드리겠습니다.


Scene_Base.prototype.createFadeSprite = function(white) {
 if (!this._fadeSprite) {
  this._fadeSprite = new ScreenSprite();
  this.addChild(this._fadeSprite);
 }
 if (white) {
  this._fadeSprite.setWhite();
 } else {
  this._fadeSprite.setBlack();
 }
};


Scene_Base.prototype.startFadeIn = function(duration, white) {
 this.createFadeSprite(white);
 this._fadeSign = 1;
 this._fadeDuration = duration || 30;
 this._fadeSprite.opacity = 255;
};

 

 

위의 startFadeIn(this.fadeSpeed(), false)에서

 

넘어오는 값 중에 white라는 변수에 어떤 값이

 

들어가는지 위의 2개 함수와 연관지어서 자세히

 

살펴봐주시기 바랍니다.

 

 

duration = this.fadeSpeed()

 

white = false

 

얼마 지나지 않아 위의 사실을 알아차릴 수 있습니다.

 

 

여기에서 실제 색상에에 영향을 주는

 

부분은 white변수 하나입니다.

 

 

white의 값이 true이면

 

this._fadeSprite.setWhite();

 

white의 값이 false이면

 

this._fadeSprite.setBlack();

 

 

입니다.

 

 

huguduk님께서 원하시는 다른 색상으로

 

그려지는 fade-in / out을 위해서는 단순히

 

true / false 스위치 값 만으로 색상을 그리는

 

형태가 되어서는 안됩니다.

 

 

fade-in / fade-out 관련 함수들중에서

 

white의 값을 직접적으로 입력해주는

 

것들을 찾아내어서 색상별로 연결되는

 

숫자 혹은 문자로 색상을 선택하는 방식으로

 

전환을 시킬 필요가 있습니다.

 

 

MV를 만든 회사에서 어떻게 업데이트를

 

진행할지는 몰라도 저 같으면...

 

처음부터 fade-in / fade-out의 색상을

 

따로 함수로 변경시키기보다는 숫자형식의

 

스위치 값을 기반으로 기본으로는 0, 1만

 

있는 형식의 것을 만들어 두었을 겁니다.

 

//include color number parameter variable

ScreenSprite.prototype.setColor = function(cn) {

 switch(cn){

  case 0://black

   this.setColor(0, 0, 0);

  break;

  case 1://white

   this.setColor(255, 255, 255);

  break;

  case 2://purple

   this.setColor(255, 0, 255);

  break;

 }
};

 

이렇게 만들어 둔다고 할 때에 cn변수의

 

값만 제대로 넣어주게 되면 다음과 같이

 

스크립트를 수정할 수도 있습니다.


Scene_Base.prototype.createFadeSprite = function(cn) {
 if (!this._fadeSprite) {
  this._fadeSprite = new ScreenSprite();
  this.addChild(this._fadeSprite);
 }
 this._fadeSprite.setColor(cn);
};


Scene_Base.prototype.startFadeIn = function(duration, cn) {
 this.createFadeSprite(cn);
 this._fadeSign = 1;
 this._fadeDuration = duration || 30;
 this._fadeSprite.opacity = 255;
};


Scene_Title.prototype.start = function() {
 Scene_Base.prototype.start.call(this);
 SceneManager.clearStack();
 this.centerSprite(this._backSprite1);
 this.centerSprite(this._backSprite2);
 this.playTitleMusic();
 this.startFadeIn(this.fadeSpeed(), 2);
};

 

 

다만 원하시는 부분들 전부를 이런 방식으로

 

재선언해주셔야 합니다. 이런 방식은 꽤나

 

피곤하지만 작성해두시고 사용하신다면

 

좀 더 다양한 응용방법에 대해서도 알아가실

 

수 있을 거라고 개인적으로 생각합니다.

 

 

 

ps.처음부터 다양한 색상을 적용할 수 있게 만들어서

 

제품으로서 팔았다고 하면 좀 더 많은 판매량을

 

이끌어 낼 수 있었을 것이라고 생각합니다만...

 

역시 돈을 벌기 위해서 서두른 것 같습니다.

?
  • ?
    huguduk 2016.06.23 14:24
    쪽지보내드렸습니다. 감사합니다!

  1. 제2회 인디사이드 게임제작대회 출품작 리스트.

    Date2016.10.24 By인디사이드운영자 Views66919 Votes0
    read more
  2. 인디사이드 활동 규정.(ver.20160119)

    Date2015.02.16 By천무 Views69962 Votes1
    read more
  3. 여자들 많은곳

    Date2026.08.28 By얼방아 Views75 Votes0
    Read More
  4. 다음 게임들을 찾고 있습니다....

    Date2026.08.25 By프로도 Views282 Votes0
    Read More
  5. 허백의 꿈 한글판 더이상 못받나요?

    Date2026.08.11 By우시오노아 Views179 Votes0
    Read More
  6. 온라인 TCG 신작 출시

    Date2026.08.04 Bykaindduel Views225 Votes0
    Read More
  7. 아르시아

    Date2026.08.03 By쥬다스 Views439 Votes0
    Read More
  8. 🎮 KOREA INDIEGAME SHOWCASE in BIC🎮

    Date2026.07.31 Bykis2025 Views301 Votes0
    Read More
  9. 빛나는 글

    Date2026.07.09 ByStarlight Views357 Votes0
    Read More
  10. Unite Seoul 2026 키노트 오픈기념 특별 프로모션 안내 - Unity CEO 방한, 세계 최초 발표

    Date2026.07.09 By회잉 Views341 Votes0
    Read More
  11. 국내 최대 규모의 Unity 개발자 컨퍼런스, Unite Seoul 2026 개최

    Date2026.06.09 By안녕하세요3 Views963 Votes0
    Read More
  12. 🕹️'2026 인디크래프트' 출품작 모집 기한 연장! (5/11까지)🕹️

    Date2026.04.23 By인디크래프트사무국26 Views1228 Votes0
    Read More
  13. 나 이하나인데 여기 보스 나와라

    Date2026.04.18 By루나라 Views1243 Votes0
    Read More
  14. 대한민국 대표 인디게임 축제, '2026 인디크래프트' 출품작 절찬 모집중! (5/6까지)

    Date2026.04.16 By인디크래프트사무국26 Views1276 Votes0
    Read More
  15. 2026 인디크래프트 출품작 모집 공고 [국내/커뮤니티/챌린저부문]

    Date2026.04.06 By인디크래프트사무국26 Views1402 Votes0
    Read More
  16. 글 쓰려다가 데모/체험판 게임이 사라진거 같은데

    Date2026.04.05 ByUSA준 Views1313 Votes0
    Read More
  17. 혹시 '이터니티' 라는게임 갖고 계시는분 있을까요?

    Date2026.02.01 ByDoingDogu Views2025 Votes0
    Read More
  18. [스마일게이트 퓨처랩] 비버롹스 2025 온라인 전시관 오픈! (12/1~12/14)

    Date2025.12.01 By스마일게이트퓨처랩 Views1774 Votes0
    Read More
  19. [스마일게이트 퓨처랩] 비버롹스 with 산나비! 게임 시연과 함께 굿즈 스토어까지!

    Date2025.11.26 By스마일게이트퓨처랩 Views1829 Votes0
    Read More
  20. [스마일게이트 퓨처랩] 놓치면 후회! 비버롹스 2차 얼리버드 티켓 절찬 판매중!

    Date2025.11.20 By스마일게이트퓨처랩 Views1775 Votes0
    Read More
  21. 코리아 인디게임 쇼케이스가 떴다

    Date2025.10.20 Bygls2024 Views1783 Votes0
    Read More
  22. GGDC 2025 글로벌게임개발자컨퍼런스 2차 공개!

    Date2025.10.18 Byggdc Views1805 Votes0
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 1178 Next
/ 1178


[개인정보취급방침] | [이용약관] | [제휴문의] | [후원창구] | [인디사이드연혁]

Copyright © 1999 - 2016 INdiSide.com/(주)씨엘쓰리디 All Rights Reserved.
인디사이드 운영자 : 천무(이지선) | kernys(김원배) | 사신지(김병국)