どもも。カサコンです。
新年早々新型コロナやらインフルエンザやら明るくないニュースが出てきていますがみなさん体調には気をつけてくださいね。
さて。先日なんですがDiscordで嬉しいことにこのbeatorajaスキンいじりの紹介をしてくださった方がいらっしゃってなんというかもう嬉しい限りです。ありがとうございます。
改めて見直してみたんですがまだ書いていないことがあったのでdecide画面に追加をしていきたいと思います。
前回の記事はこちら
決められた条件でのみ表示出来るop定義
前回の記事でもさり気なく使っていたりするのですが画像を限られた条件で使いたいという場合にはop定義を使用します。例えばこんな画像があったとします。
この画像を使ってビギナー譜面の時には一番上の画像、アナザー譜面の時には赤い画像のみを表示したいとかいった場合に活躍するのがop定義です。
まずはいつものようにsource定義とimage定義でそれぞれの画像を指定します。
"source": [ {"id":3, "path":"difficult.png"}, ], "image":[ {"id":"bigginer", "src":3, "x":0, "y":0, "w":320, "h":97}, {"id":"normal", "src":3, "x":0, "y":97, "w":320, "h":97}, {"id":"hyper", "src":3, "x":0, "y":194, "w":320, "h":97}, {"id":"another", "src":3, "x":0, "y":291, "w":320, "h":97}, {"id":"another2", "src":3, "x":0, "y":388, "w":320, "h":97}, ],
そしてdestination定義で画像を配置していくのですがここでop定義を使います。こんな感じ。
"destination":[ {"id":"bigginer", "op":[151], "dst":[{"x":30, "y":920, "w":320, "h":97}]}, {"id":"normal", "op":[152], "dst":[{"x":30, "y":920, "w":320, "h":97}]}, {"id":"hyper", "op":[153], "dst":[{"x":30, "y":920, "w":320, "h":97}]}, {"id":"another", "op":[154], "dst":[{"x":30, "y":920, "w":320, "h":97}]}, {"id":"another2", "op":[155], "dst":[{"x":30, "y":920, "w":320, "h":97}]}, ]
こうすることでopに指定された条件の場合でのみ画像を表示することが出来るようになります。例えばanotherのIDでは154というop値が指定されていますがこれはdifficulty4(アナザー譜面)の時のみ表示される数字となります。
op値にはもっと様々なものが用意されているので下のリンクを参考にするといいです。
カスタムオプションを指定できるpropety定義
propety定義を使うことでユーザー側でop定義を指定することが出来るようになります。
例えばdecide画面からplay画面に移るときにゆっくりとフェードアウトする処理が書かれてあったとした場合に何色にフェードアウトするのかを切り分けたりすることが出来ます。
"property":[ {"name":"フェードアウト時の色", "item":[ {"name":"white", "op":920}, {"name":"black", "op":921}, ]}, ],
propety定義にこのように記述するとスキン選択画面で「フェードアウト時の色」という項目が追加され「white」「black」を選択出来るようになります。
そして「white」を選択するとop値920がONとなり「black」を選択すると921がONとなります。使い方はop値の使い方と同じです。
"source": [ {"id":4, "path":"parts01.png"}, ], "image":[ {"id":"blank_white", "src":4, "x":600, "y":337, "w":8, "h":8}, {"id":"blank_black", "src":4, "x":608, "y":337, "w":8, "h":8}, ], "destination":[ {"id":"blank_white", "op":[920], "loop":500, "timer":2 ,"dst":[ {"time":0, "x":0, "y":0, "w":1920, "h":1080, "a":0}, {"time":500,"a":255} ]}, {"id":"blank_black", "op":[921], "loop":500, "timer":2 ,"dst":[ {"time":0, "x":0, "y":0, "w":1920, "h":1080, "a":0}, {"time":500,"a":255} ]} ]
ちなみにカスタムオプションには900番~999番を使うことが可能のようです。
多そうに見えますが意外とあっさり使ってしまうので使う際には計画的にw
あと今更ですが上の使い方では画像が変わった以外は処理が全く同じなのでこのような場合はfilepath定義を使ったほうがいいかもしれないです。その使い方については次回書きたいと思いますのでお楽しみに。
これまでの(若干変更)
{ "type":6, "name":"GPaper", "w":1920, "h":1080, "fadeout":500, "scene":3000, "input":500, "property":[ {"name":"フェードアウト時の色", "item":[ {"name":"white", "op":920}, {"name":"black", "op":921}, ]}, ], "source": [ {"id":1, "path":"number.png"}, {"id":2, "path":"bg.png"}, {"id":3, "path":"difficult.png"}, {"id":4, "path":"parts01.png"}, ], "font": [ {"id":0, "path":"title.fnt"} {"id":1, "path":"subtitle.fnt", "type":1} ], "image":[ {"id":"blank_white", "src":4, "x":600, "y":337, "w":8, "h":8}, {"id":"blank_black", "src":4, "x":608, "y":337, "w":8, "h":8}, {"id":"bg", "src":2, "x":0, "y":0, "w":1920, "h":1080}, {"id":"banner_spase", "src":4, "x":0, "y":0, "w":600, "h":480}, {"id":"notes-graph_spase", "src":4, "x":0, "y":480, "w":1326, "h":490}, {"id":"music-info-logo", "src":4, "x":600, "y":210, "w":473, "h":85}, {"id":"arrow-base", "src":4, "x":600, "y":0, "w":726, "h":210}, {"id":"arrow-move", "src":4, "x":1350, "y":0, "w":850, "h":210 }, {"id":"gear_s", "src":4, "x":2198, "y":0, "w":190, "h":190}, {"id":"gear_b", "src":4, "x":1350, "y":337, "w":586, "h":586}, {"id":"bpm-logo", "src":4, "x":1350, "y":210, "w":290, "h":55}, {"id":"from", "src":4, "x":600, "y":294, "w":38, "h":43}, {"id":"totalnotes-logo", "src":4, "x":1652, "y":210, "w":379, "h":55}, {"id":"bigginer", "src":3, "x":0, "y":0, "w":320, "h":97}, {"id":"normal", "src":3, "x":0, "y":97, "w":320, "h":97}, {"id":"hyper", "src":3, "x":0, "y":194, "w":320, "h":97}, {"id":"another", "src":3, "x":0, "y":291, "w":320, "h":97}, {"id":"another2", "src":3, "x":0, "y":388, "w":320, "h":97}, {"id":"thumbtack", "src":4, "x":1100, "y":210, "w":75, "h":85}, ], "value":[ {"id":"maxbpm", "src":1, "x":0, "y":0, "w":380, "h":43, "divx":10, "digit":4, "ref":90, "align":2}, {"id":"minbpm", "src":1, "x":0, "y":0, "w":380, "h":43, "divx":10, "digit":4, "ref":91, "align":2}, {"id":"totalnotes", "src":1, "x":0, "y":0, "w":380, "h":43, "divx":10, "digit":4, "ref":74, "align":2}, ], "text":[ {"id":"genre", "font":1, "size":40, "ref":13, "wrapping":"false", "overflow":1, "outlineColor":"000000ff", "outlineWidth":1}, {"id":"title", "font":1, "size":70, "ref":12, "wrapping":"false", "overflow":1, "outlineColor":"000000ff", "outlineWidth":1}, {"id":"artist", "font":1, "size":40, "ref":14, "wrapping":"false", "overflow":1, "outlineColor":"000000ff", "outlineWidth":1}, ], "judgegraph": [ {"id":"notes-graph", "type" : 0} ], "bpmgraph": [ {"id":"bpmgraph"} ], "destination":[ {"id":"bg", "dst":[{"x":0, "y":0, "w":1920, "h":1080}]}, {"id":"arrow-base", "dst":[{"x":366, "y":866, "w":726, "h":210}]}, {"id":"arrow-move", "dst":[ {"time":0, "x":498, "y":866, "w":850, "h":210}, {"time":4000, "x":1090, "acc":2} ]}, {"id":"music-info-logo", "dst":[{"x":1340, "y":933, "w":473, "h":85}]}, {"id":"gear_s", "dst":[ {"time":0, "angle":0, "x":-95, "y":-95, "w":190, "h":190}, {"time":5000, "angle":-360} ]}, {"id":"gear_b", "dst":[ {"time":0, "angle":0, "x":1627, "y":-293, "w":586, "h":586}, {"time":5000, "angle":360} ]}, {"id":"banner_spase", "dst":[{"x":12, "y":421, "w":600, "h":480}]}, {"id":"notes-graph_spase", "dst":[{"x":595, "y":421, "w":1326, "h":485}]}, {"id":-100, "dst":[ {"x":80, "y":455, "w":510, "h":380} ]}, {"id":"genre", "loop":2000, "dst":[ {"time":0, "x":75, "y":250, "w":1700}, {"time":2000, "x":120, "acc":2} ]}, {"id":"title", "dst":[ {"x":75, "y":170, "w":1800, "r":242, "g":224, "b":200} ]}, {"id":"artist", "loop":2000, "dst":[ {"time":0, "x":75, "y":70, "w":1700}, {"time":2000, "x":120, "acc":2} ]}, {"id":"notes-graph", "dst":[ {"x":660, "y":460, "w":1200, "h":380} ]}, {"id":"bpmgraph", "op":[177,-1177], "dst":[ {"x":660, "y":460, "w":1200, "h":380} ]}, {"id":"bpmgraph", "op":[1177], "dst":[ {"x":660, "y":460, "w":1200, "h":380} ]}, {"id":"bpm-logo", "dst":[{"x":640, "y":317, "w":290, "h":55}]}, {"id":"maxbpm", "dst":[{"x":1150, "y":325, "w":38, "h":43}]}, {"id":"minbpm", "dst":[{"x":945, "y":325, "w":38, "h":43}]}, {"id":"from", "dst":[{"x":1100, "y":325, "w":38, "h":43}]}, {"id":"totalnotes-logo", "dst":[{"x":1330, "y":317, "w":379, "h":55}]}, {"id":"totalnotes", "dst":[{"x":1730, "y":325, "w":38, "h":43}]}, {"id":"bigginer", "op":[151], "dst":[{"x":30, "y":920, "w":320, "h":97}]}, {"id":"normal", "op":[152], "dst":[{"x":30, "y":920, "w":320, "h":97}]}, {"id":"hyper", "op":[153], "dst":[{"x":30, "y":920, "w":320, "h":97}]}, {"id":"another", "op":[154], "dst":[{"x":30, "y":920, "w":320, "h":97}]}, {"id":"another2", "op":[155], "dst":[{"x":30, "y":920, "w":320, "h":97}]}, {"id":"thumbtack", "dst":[{"x":280, "y":810, "w":75, "h":85}]}, {"id":"thumbtack", "dst":[{"x":1200, "y":825, "w":75, "h":85}]}, {"id":"blank_white", "op":[920], "loop":500, "timer":2 ,"dst":[ {"time":0, "x":0, "y":0, "w":1920, "h":1080, "a":0}, {"time":500,"a":255} ]}, {"id":"blank_black", "op":[921], "loop":500, "timer":2 ,"dst":[ {"time":0, "x":0, "y":0, "w":1920, "h":1080, "a":0}, {"time":500,"a":255} ]} ] }