RPGXP スクリプト
2016.07.22 23:02

Font Setup

閲覧数 1778 推奨数 0 コメント 0
Atachment
添付 '3'
?

Shortcut

Prev前へ 書き込み

Next次へ 書き込み

Larger Font Smaller Font 上へ 下へ Go comment 印刷
?

Shortcut

Prev前へ 書き込み

Next次へ 書き込み

Larger Font Smaller Font 上へ 下へ Go comment 印刷

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
番号 カテゴリ タイトル 投稿者 日付 閲覧数 推奨数
288 RPG MVプラグイン Mog_Battle_hud(MZ버전도 있습니다) 스트레이보우 2021.03.05 2011 0
287 RPG MVプラグイン 컷신 플러그인 스트레이보우 2020.10.30 2694 0
286 RPG MVプラグイン 업적플러그인 스트레이보우 2020.09.02 2262 0
285 RPGXP スクリプト 한글조합입력기(영어가능) file 조규진1 2019.11.10 1201 0
284 RPG MVプラグイン 게임에서 제공해주는 노래가 아닌 외부에서 다운받고 안에 넣어쓰려면 어떻게 해야하나요? 3 BigOrca 2019.07.26 1650 0
283 RPG MVプラグイン Ghost Effect 러닝은빛 2019.01.20 1323 0
282 RPGXP スクリプト RPG XP Xas액알 1 file 심심치 2018.10.30 1331 0
281 RPG MVプラグイン 커스텀 숫자 입력 패드 1 file 러닝은빛 2018.10.19 1399 0
280 RPG MVプラグイン 9마리 이상의 몬스터 설정 | More Enemies 러닝은빛 2018.08.31 1150 0
279 RPG MVプラグイン 동적 맵 타일 수정 플러그인 베지테리안카카오 2018.07.17 1251 0
278 RPG VX Ace スクリプト VXA에서 XBOX360 컨트롤러 사용 여부 체크 file 러닝은빛 2018.07.15 1053 0
277 RPG MVプラグイン RMMV 옵션 창에 메시지 속도 및 글자 크기 변경 기능 추가 file 러닝은빛 2018.07.15 1795 0
276 RPG MVプラグイン 한글 데미지 표시 file 러닝은빛 2018.07.09 1613 0
275 RPG MVプラグイン [ MV ] 심장[체력표시 하트] 플러그인 file 수성의물 2018.07.01 2407 0
274 RPG MVプラグイン [鳥小屋] 실적 플러그인(인게임 트로피 시스템) file 이니군 2017.10.31 1909 0
273 RPG VX Ace スクリプト LuD Script Package 1 file LuD 2017.08.16 1822 0
272 RPG VX Ace スクリプト [VXAce] 레이어 맵 <layer> 시스템 file LuD 2017.08.07 1478 0
271 RPG MVプラグイン [RPG MV] 퀘스트 마커 지속 표시 플러그인 file lklslel 2017.04.09 1875 0
270 RPG MVプラグイン Mirror Area - RPG Maker MV 2 file 러닝은빛 2017.01.03 5181 0
269 RPG MVプラグイン Keyboard Event - RPG Maker MV 1 러닝은빛 2017.01.03 2456 0
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 15 Next
/ 15