|
|
|
-- === エディタ上で表示する情報を返す === |
|
function GetInfo() |
|
local info = { |
|
name = "rect-wipe-in", |
|
displayname = { |
|
en = "Rect-wipe-in", |
|
ja = "ワイプ(四角形/内側)" |
|
} |
|
} |
|
return info |
|
end |
|
|
|
|
|
|
|
-- === 諸々の何もしない関数 === |
|
function InitTransition() |
|
-- do nothing |
|
end |
|
|
|
function UpdateProperty() |
|
-- do nothing |
|
end |
|
|
|
function Order() |
|
return 0 |
|
end |
|
|
|
|
|
|
|
-- === 前の動画の表示 === |
|
function RenderA(effInfo, tex, param) |
|
Draw(tex, param) |
|
end |
|
|
|
|
|
|
|
-- === 後の動画の表示 === |
|
function RenderB(effInfo, tex, param) |
|
-- 各種情報の取得 |
|
local et = effInfo.t --エフェクト時間(0~1) |
|
local rect = param.bounds --表示範囲 |
|
local uv = param.uv --図形自体の情報(xもyも0~1らしい) |
|
-- ワイプの四角形の大きさを計算 |
|
local rectWidth = math.max(rect.w, rect.h) * (1 - et) |
|
local uvWidth = math.max(uv.w, uv.h) * (1 - et) |
|
local uvRatio = rect.w / rect.h |
|
-- 頂点情報を用意する(?) |
|
local segRect1 = Rect(rect.x, rect.y, (rect.w-rectWidth)/2, rect.h) |
|
local segRect2 = Rect(rect.x+(rect.w+rectWidth)/2, rect.y, (rect.w-rectWidth)/2, rect.h) |
|
local segRect3 = Rect(rect.x+(rect.w-rectWidth)/2, rect.y, rectWidth, (rect.h-rectWidth)/2) |
|
local segRect4 = Rect(rect.x+(rect.w-rectWidth)/2, rect.y+(rect.h+rectWidth)/2, rectWidth, (rect.h-rectWidth)/2) |
|
local points1 = VEC3.Plate(segRect1) |
|
local points2 = VEC3.Plate(segRect2) |
|
local points3 = VEC3.Plate(segRect3) |
|
local points4 = VEC3.Plate(segRect4) |
|
-- 描画する |
|
param.uv = Rect(uv.x, uv.y, (uv.w-uvWidth)/2, uv.h) |
|
Draw3DPlate(points1, tex, param) |
|
param.uv = Rect(uv.x+(uv.w+uvWidth)/2, uv.y, (uv.w-uvWidth)/2, uv.h) |
|
Draw3DPlate(points2, tex, param) |
|
param.uv = Rect(uv.x+(uv.w-uvWidth)/2, uv.y, uvWidth, (uv.h-uvWidth*uvRatio)/2) |
|
Draw3DPlate(points3, tex, param) |
|
param.uv = Rect(uv.x+(uv.w-uvWidth)/2, uv.y+(uv.h+uvWidth*uvRatio)/2, uvWidth, (uv.h-uvWidth*uvRatio)/2) |
|
Draw3DPlate(points4, tex, param) |
|
end |
雑アイコンはこちら。2つの画像が同じものに見える場合、あなたの目は正常なので安心してほしい。

