Views 1566 Votes 0 Comment 2
Atachment
Attachment '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

스크립트 초짜라 여러 스크립트 뜯어보면서 공부중입니다...

하다보니깐 아래 처럼 작성해서 사용하니깐 글자의 색상이 모두 똑같에 출력되더라고요...

아래 VAR_LIST는 게임상에서 화면에 출력되는 것입니다.

 

물 60

불 70

흙 13

 

이런식으로 출력되는데, 이 출력되는 색상을 각자 색상을 달리 주고 싶습니다.......

 

 

 

생략 

 

VAR_LIST = [] 
VAR_LIST[0] = [21,"물", 543]      
# 옆부분을 [21,"물", 543, color.new(255,255,255)] 이런식으로 사용하려면 어떻게 해야할까요?
VAR_LIST[1] = [59,"불", 544]      # 첨부파일에 원본 스크립트 넣어놨습니다. txt는 업로드 불가능이라 알집으로 압축해서 올립니다.
VAR_LIST[2] = [60,"흙", 545]

 

생략

 

def draw_var(var, unit, x, y, width)
    # // Method to draw a variable with the content.
    value = "#{$game_variables[var]}#{KYK_VAR_HUD::SYMBOL}"
    contents.font.name = KYK_VAR_HUD::FONT_NAME
    contents.font.size = KYK_VAR_HUD::FONT_SIZE
    contents.font.bold = KYK_VAR_HUD::FONT_BOLD
    contents.font.italic = KYK_VAR_HUD::FONT_ITALIC
    contents.font.color = KYK_VAR_HUD::FONT_COLOR
    contents.font.shadow = KYK_VAR_HUD::FONT_SHADOW
    contents.font.out_color = KYK_VAR_HUD::FONT_SHADOW_COLOR

    draw_text(x+38, y, width-50, line_height, value, 0)
    draw_text(x+2, y, width-20, line_height, unit, 0) unless unit.nil?
    reset_font_settings
  end

 

생략

?
  • ?
    dd 2016.02.16 22:17
    ...

    # VAR_LIST = [variable_id, vocab (nil), icon_index (nil), x, y]

    VAR_LIST = [] # Don't remove!

    VAR_LIST[0] = [21,"물", 1, Color.new(255,0,0)]

    VAR_LIST[1] = [59,"불", 2, Color.new(0,255,0)]

    VAR_LIST[2] = [60,"흙", 3, Color.new(0,0,255)]

     

    ...

     

      def draw_var(var, unit, x, y, width, color=KYK_VAR_HUD::FONT_COLOR)
        # // Method to draw a variable with the content.
        value = "#{$game_variables[var]}#{KYK_VAR_HUD::SYMBOL}"
        contents.font.name = KYK_VAR_HUD::FONT_NAME
        contents.font.size = KYK_VAR_HUD::FONT_SIZE
        contents.font.bold = KYK_VAR_HUD::FONT_BOLD
        contents.font.italic = KYK_VAR_HUD::FONT_ITALIC
        contents.font.color = color
        contents.font.shadow = KYK_VAR_HUD::FONT_SHADOW
        contents.font.out_color = KYK_VAR_HUD::FONT_SHADOW_COLOR

        
        ## 맨끝의 0 왼쪽부터, 1 가운데, 2 오른쪽부터 글자의 정렬임
        ##       (x+30 <- 문자가 아닌 숫자 위치)
        draw_text(x+38, y, width-50, line_height, value, 0)
        draw_text(x+2, y, width-20, line_height, unit, 0) unless unit.nil?
        reset_font_settings
      end

     

    ...

     

      def draw_var_hud
        # // Method to draw the var hud.
        y = 0
        @vars = {}
        for i in KYK_VAR_HUD::VAR_LIST
          x = i[1].nil? ? 32 : 0 
          ##                   x +26 <- 부분 문자 위치
          draw_var(i[0], i[1], x +28, y, contents.width - 8, i[3])
          ##       (i[2], 0 <- 부분 아이콘 위치
          draw_icon(i[2], 0 , y - 1) unless i[2].nil?
          y += KYK_VAR_HUD::SPACING
          @vars[i[0]] = $game_variables[i[0]]
        end
      end

  • profile
    몽롱하다 2016.02.17 00:13
    헐 짱이에요..................
    많은걸 깨달았습니다 ㅠㅠ!

  1. 쯔꾸르 mv 게임을 apk 파일로 변환했는데...

    Date2023.01.14 By박하맛 Views2184
    Read More
  2. 쯔꾸르 젖소이야기 결혼 방법좀 알려주세요...

    Date2021.12.20 By백지씨 Views3649
    Read More
  3. apk포팅 승인 어케 하나요?

    Date2021.11.29 Bygame메이커xp Views2083
    Read More
  4. Yanfly님의 Action Sequence Pack 질문드립니다

    Date2021.07.15 ByNeuromancer Views2615
    Read More
  5. 싸게 MV 를 먼저? 아니면 돈을 더 들어서라도 MZ?

    Date2021.07.06 ByXatra Views2832
    Read More
  6. RMMV - 스탯창과 대화창 변견 관련 질문입니다. (초보입니다 도움좀 주세요 ㅜㅜ)

    Date2021.01.22 Byscribble Views2433
    Read More
  7. 아오오니를 하는 사람인데요 질문 두가지가 있어요

    Date2021.01.16 By오니개무서워 Views2504
    Read More
  8. 재밌는게임

    Date2020.12.07 Byland_tnt Views2276
    Read More
  9. c언어 질문

    Date2020.11.10 By세종기항19 Views2650
    Read More
  10. 코딩 질문

    Date2020.11.08 By세종기항19 Views2530
    Read More
  11. 혹시나 물어보는데

    Date2020.11.07 By드래곤규 Views2556
    Read More
  12. 오픈보 게임 더블드래곤 리로디드 얼티네이트에 대해 궁금

    Date2020.09.09 By이부닝 Views2065
    Read More
  13. 상태이상 확률 결정

    Date2020.09.02 By스트레이보우 Views1816
    Read More
  14. 다음 인디사이드 제작대회는 언제쯤 열릴까요?

    Date2020.05.23 ByWOONAALAA Views1834
    Read More
  15. xp로 제작된 어플 실행자체가 안된다는 분이 있습니다.(제생각엔 apk로 변환하는 과정에서 버전자체가 낮은 것 같습니다)

    Date2020.05.04 By라엔 Views2282
    Read More
  16. apk 포팅하는데 게임 이름이 필요합니다 뜨는데

    Date2020.05.03 Bykashu Views2162
    Read More
  17. 쯔꾸르VX Ace렉먹음 도와주세요...

    Date2020.03.22 By랖랖 Views2811
    Read More
  18. 안녕하세요

    Date2020.02.14 By청월령 Views1751
    Read More
  19. 포팅 중 '게임 이름이 필요합니다' 오류

    Date2020.02.11 By아이비스 Views1695
    Read More
  20. RPGMV 거리 추적

    Date2020.01.19 By정욱 Views1719
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 442 Next
/ 442


[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)