Views 502 Votes 0 Comment 1
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

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인디사이드운영자 Views55056 Votes0
    read more
  2. 인디사이드 활동 규정.(ver.20160119)

    Date2015.02.16 By천무 Views57678 Votes1
    read more
  3. 모태솔로가 여자 만나기 위해 노력한 후기

    Date2026.07.05 By우쭈앙 Views44 Votes0
    Read More
  4. 국내 최대 규모의 Unity 개발자 컨퍼런스, Unite Seoul 2026 개최

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

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

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

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

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

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

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

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

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

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

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

    Date2025.10.18 Byggdc Views936 Votes0
    Read More
  16. BEAVER ROCKS 2025 슈퍼 얼리버드 티켓 오픈!

    Date2025.10.17 By스마일게이트퓨처랩 Views913 Votes0
    Read More
  17. 이제 여기 다운로드는 다 막힌건가

    Date2025.10.12 ByRedgm Views1284 Votes0
    Read More
  18. 안녕하세요

    Date2025.09.30 By우사준 Views1048 Votes0
    Read More
  19. 혹시 이 사이트의 등업관련해서 질문이있는데요

    Date2025.09.23 By이드냐 Views1198 Votes0
    Read More
  20. GGDC 2025 글로벌 게임 개발자 컨퍼런스

    Date2025.09.18 Byggdc Views1421 Votes0
    Read More
  21. NGC2025 사전등록 이벤트 소식~ ^^

    Date2025.09.18 By태사자 Views1019 Votes0
    Read More
  22. [대구디지털혁신진흥원] (NGC2025) NEXT GAME CONFERENCE 2025

    Date2025.09.12 By태사자 Views1049 Votes0
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 1178 Next
/ 1178


[privacy statements] | [Terms of Use] | [Contact us] | [Sponsorship] | [Indiside History]

Copyright © 1999 - 2016 INdiSide.com/CL3D Co., Ltd. All Rights Reserved.
Owner : Chunmu(Jiseon Lee) | kernys(Wonbae Kim) | Sasinji(Byungkook Kim)