RPGXP 스크립트
2016.07.22 23:02

Font Setup

조회 수 1447 추천 수 0 댓글 0
Atachment
첨부 '3'
?

단축키

Prev이전 문서

Next다음 문서

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

단축키

Prev이전 문서

Next다음 문서

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

FONT.PNG

Font Setup

 다운로드

https://drive.google.com/file/d/0B-cKNhJz3SPESW1mZHZqNGJlVUk/view?usp=sharing

 

 설명

폰트가 없을 시 메세지창이 뜨면서 게임이 종료됩니다.

LIST에 해당 폰트에 이름이랑 .ttf파일이 있으면 (암호화 상태에서도)

Fonts폴더가 생성되고 그 안에 폰트 .ttf파일이 생성됩니다.

+

네코 플레이어에서도

폰트 적용이 가능합니다.

 

 사용법

Font.setup

 

 추가하는법

Datas/Fonts폴더 안에 폰트 이름.ttf 파일을 넣고

  LIST 해시 변수 사이에

  

  "폰트 이름" => "Fonts/폰트 이름.ttf", 

  

  으로 폰트를 추가할 수있습니다.

 

 사진

0.PNG

1.png

 동영상

http://blog.naver.com/unjong_/220769185578

 

 갱신 날짜

2016.07.22 오후 10:20

 

 스크립트

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

#==============================================================================

# ** Font

#------------------------------------------------------------------------------

# * Auhor => UNJONG (unjong_@naver.com)

# * Dat => 2016.07.22

# * Syntax => Ruby 1.8.1 (RMXP)

#==============================================================================

 

class Font

  

  # 디폴트 이름

  @@default_name = "맑은 고딕"

  

  # 디폴트 크기

  @@default_size = 24

  

  # 디폴트 볼드

  @@default_bold = false

  

  # 디폴트 이탤릭

  @@default_italic = false

  

  # 디폴트 색깔

  @@default_color = Color.new(255, 255, 255)

  

  # 목록

  LIST = {

  

  "맑은 고딕" => "Fonts/malgun", 

  

  "나눔명조" => "Fonts/NanumMyeongjo", 

  

  }

  

  # Win32API

  ShellExecute = Win32API.new("shell32", "ShellExecute", "lppppl", "l")

  

  # 셋업

  def self.setup

    # 네코

    neko

    # 윈도우

    window

  end

  

  # 네코

  def self.neko

    if ENV['OS'] == "Android"

      route = sprintf("%s/KernysRGSS/", 

      ENV['EXTERNAL_STORAGE'])

      i = @@default_name.is_a?(Array) ? 

      @@default_name[0] : @@default_name

      data = Encryption.load_file(LIST[i], ".ttf")

      if File.exist?(route + "font.ttf")

        if File.size(route + "font.ttf") == data[0].size

          return

        end

      end

      Encryption.write_file(route + "font.ttf", data)

    end

  end

  

  # 윈도우

  def self.window

    @@default_name.each do |i|

      unless Font.exist?(i)

        msgbox(i + " 폰트가 없습니다. 폰트를 설치해주시기 바랍니다.")

        exit if LIST[i].nil?

        Encryption.save_file(LIST[i], ".ttf")

        ShellExecute.call(0, "open", Dir.pwd + "/Fonts", 0, 0, 1)

        exit

      end

    end

  end

end

 

 

#==============================================================================

# ** Encryption

#==============================================================================

 

module Encryption

  

  # 파일 저장

  def self.save_file(filename, extend)

    return if exist?(filename, extend)

    data = load_file(filename, extend)

    return if data.nil?

    filename << data[1]

    create_dir(filename)

    write_file(filename, data[0])

    filename

  end

  

  # 파일 존재

  def self.exist?(filename, extend)

    data = nil

    extend.each do |i|

      data = File.exist?(filename + i)

      if data.is_a?(TrueClass)

        break 

      end

    end

    data

  end

  

  # 파일 로드

  def self.load_file(filename, extend)

    data = nil

    extend.each do |i|

      if data != nil

        break

      end

      begin

        data = [load_data("Data/" + filename + i), i]

      rescue

        nil

      end

    end

    data

  end

  

  # 파일 쓰기

  def self.write_file(filename, data)

    File.open(filename, "wb") do |f| 

      f.write(data)

    end

  end

  

  # 폴더 생성

  def self.create_dir(path)

    path = path.split("/")

    path.each do |i|

      if i.include?(".")

        path.pop

      end

    end

    subpath = ""

    path.each do |i|

      subpath << i << "/"

      unless File.exist?(subpath)

        Dir.mkdir(subpath)

      end

    end

    subpath

  end

end

 

#==============================================================================

# ** Marshal

#==============================================================================

 

module Marshal

  

  # 셀프 클래스

  class << self

    

    # 메소드 별명

    alias_method(:mar_load, :load) unless method_defined?(:mar_load)

    

    # 로드

    def load(port)

      mar_load(port)

    rescue TypeError

      if port.is_a?(File)

        port.rewind

        port.read

      else

        port

      end

    end

  end

end

 

#==============================================================================

# ** msgbox

#==============================================================================

 

def msgbox(*args)

  print(args.collect { |arg| arg.to_s }.join("\n"))

end unless defined?(msgbox)

 

#==============================================================================

# ** msgbox_p

#==============================================================================

 

def msgbox_p(*args)

  print(args.collect { |obj| obj.inspect }.join("\n"))

end unless defined?(msgbox_p)

 

Colored by Color Scripter

cs

 

 

 

 

?

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수 추천 수
108 RPGXP 스크립트 경험치 표시 스크립트 청담 2013.09.24 747 0
107 RPGXP 스크립트 지정한 아이템 갯수 제한 스크립트 청담 2013.09.24 1133 0
106 RPGXP 스크립트 아이템 사용 클래스 한정 스크립트 청담 2013.09.24 945 0
105 RPGXP 스크립트 자동 세이브 스크립트 1 청담 2013.09.24 841 0
104 RPGXP 스크립트 죽었을경우 마을로이동 스크립트 1 청담 2013.09.24 1063 0
103 RPGXP 스크립트 플레이어 발소리 스크립트 1 청담 2013.09.24 937 0
102 RPGXP 스크립트 상점 메뉴 개조시킨 스크립트 1 청담 2013.09.24 1002 0
101 RPGXP 스크립트 몬스터 도감 1 청담 2013.09.24 1419 0
100 RPGXP 스크립트 메뉴에 얼굴 그래픽 표시 청담 2013.09.24 830 0
99 RPGXP 스크립트 직업명 띄우기 청담 2013.09.24 769 0
98 RPGXP 스크립트 동료가 기차처럼 따라오는 스크립트 청담 2013.09.24 1117 0
97 RPGXP 스크립트 아이디 띄우기 7 청담 2013.09.24 1027 0
96 RPGXP 스크립트 캐릭터 그림자 2 청담 2013.09.24 1546 0
95 RPGXP 스크립트 촬영 기술(부드러운 맵스크롤) 2 청담 2013.09.24 1650 0
94 RPGXP 스크립트 game testplay 테스트중 게임속도 상승 스크립트 6 부초 2013.09.24 785 0
93 RPGXP 스크립트 [아힝흥행]레벨한계 돌파 스크립트 3 아힝흥행 2013.09.24 1096 0
92 RPGXP 스크립트 미니맵 스크립트 2 청담 2013.09.20 1873 0
91 RPGXP 스크립트 맵 이름 표시 스크립트 5 청담 2013.09.20 1438 0
90 RPGXP 스크립트 모든 글자에 외곽선 넣는 스크립트 청담 2013.09.20 1183 0
89 RPGXP 스크립트 게임프레임 조절 1 청담 2013.09.20 1802 0
Board Pagination Prev 1 ... 5 6 7 8 9 10 11 12 13 14 15 Next
/ 15






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

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