forked from M1A2C/AviutlDevelopingScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoopTextures.anm
More file actions
39 lines (33 loc) · 1.21 KB
/
LoopTextures.anm
File metadata and controls
39 lines (33 loc) · 1.21 KB
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
--[[
簡易版テクスチャループ。
一応エラーだけ吐くようにしておきました。
]]
--track0:0づけ,0,1,0,1
--track2:skip,0,50,2,1
--track3:random,0,1,0,1
--check0:パスを表示する,1
--dialog:$フォルダ1,local path=";拡張子,local ext="jpg";0を最初とする/chk,local isAddZeroAhead=0;ランダムを繰り返す/chk,local isLoopRand=1;
require("rikky_module")
rikky_module.fold(1)
obj.setfont("メイリオ",50)
if(path~="") and (ext~="") then
local isAddZeroAhead=obj.track0 and true or false
local skipflame,israndom=obj.track2,obj.track3
local files=rikky_module.dir(path,ext)
local n=#files
local f=math.floor(obj.frame/skipflame)
local a=obj.check0 and 0 or 1
local r=(f%n+1)*(1-israndom)+obj.rand(a,n,f%n,math.ceil(f/n)*isLoopRand)*(israndom)
local file=files[r]
if(obj.check0==false) then
obj.load("image",file)
else
obj.setfont("メイリオ",30)
obj.load("パス:\n"..file)
end
if(obj.getinfo("saving")==false) then debug_print("load file path: "..file..";") end
elseif(path=="") then
obj.load("パスが設定されていません。\nダイアログを開いて、「$フォルダ1」に\n「$」と入力してみてください。")
elseif(ext=="") then
obj.load("拡張子が設定されていません。\nダイアログを開いて設定してください。")
end