コミットを比較
| 作成者 | SHA1 | 日付 | |
|---|---|---|---|
|
|
3dc06dbeb3
|
||
|
|
5c4e1de447
|
||
|
|
488a70ece1
|
||
|
|
41906f81e9
|
検索条件に一致するファイルはありません
+42
-23
@@ -1,35 +1,54 @@
|
|||||||
# v1.1.1 - Lua スクリプト for YMM4
|
# v1.2.0 - Lua スクリプト for YMM4
|
||||||
|
|
||||||
特定のテーマでスクリプトエディタを開いた際に発生する例外を修正したリリースです。
|
他オブジェクトの情報を任意のフレーム時点で取得できるようにしたリリースです。
|
||||||
|
発射元が動いても弾の発射位置を固定するなど、フレームを指定した参照が可能になりました。
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 修正
|
## 新機能
|
||||||
|
|
||||||
### 1. テーマに対応するシンタックス定義の不足による例外
|
### 1. obj.getobject へのフレーム指定引数の追加
|
||||||
|
|
||||||
YMM4 のテーマが「Windows」または「Black」のとき、スクリプトエディタの表示時に
|
`obj.getobject(tag, frame)` の第2引数 `frame` を追加しました。指定したタイムライン
|
||||||
`System.IO.IOException` が発生する不具合を修正しました。
|
フレーム時点での対象オブジェクトの座標・回転・拡大率・不透明度を取得できます。
|
||||||
|
`frame` を省略した場合は従来どおり現在フレームの値を返します。
|
||||||
|
|
||||||
スクリプトエディタ (`CodeEditor`) は現在のテーマ名から
|
弾の発射フレーム(弾アイテムの開始フレーム)は `timelineframe - frame` で求まるため、
|
||||||
`Lua-{テーマ名}.xshd` を解決しますが、本プラグインは `Lua-Dark.xshd` と
|
そのフレームの発射元座標を取得すれば、発射元が動いても弾の原点を発射位置に固定できます。
|
||||||
`Lua-Light.xshd` のみを同梱していたため、テーマ名が `Windows` や `Black` の場合に
|
|
||||||
対応するシンタックス定義が見つからず例外となっていました。
|
|
||||||
|
|
||||||
不足していた以下の 2 ファイルを追加しました。
|
```lua
|
||||||
|
local fire = timelineframe - frame
|
||||||
|
local src = obj.getobject("routersys", fire)
|
||||||
|
if src then
|
||||||
|
obj.x = src.x
|
||||||
|
obj.y = src.y
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
| ファイル | 配色 | 対応テーマ |
|
取得値は対象アイテム自身の座標・回転・拡大率であり、グループ制御・カメラ制御による
|
||||||
|---|---|---|
|
変形は含みません。同じタグのアイテムが複数ある場合は、対象フレームで表示中のものを
|
||||||
| `Lua-Black.xshd` | 暗背景向け | Black |
|
優先して返します。
|
||||||
| `Lua-Windows.xshd` | 明背景向け | Windows |
|
|
||||||
|
|
||||||
配色は YMM4 のテーマの明暗(Black は暗背景、Windows は明背景)に合わせ、
|
---
|
||||||
既存の `Lua-Dark.xshd`・`Lua-Light.xshd` と統一しています。これにより
|
|
||||||
Black・Dark・Light・Windows のいずれのテーマでもシンタックスハイライトが
|
|
||||||
適用されます。
|
|
||||||
|
|
||||||
### 2. プロジェクトファイルへのリソース登録
|
## 内部実装
|
||||||
|
|
||||||
追加した 2 ファイルを `LuaScript.csproj` に `Resource` として登録しました。
|
### 2. 参照方式の統一(依存クエリの再評価)
|
||||||
シンタックス定義は pack URI 経由でアセンブリに埋め込まれて参照されるため、
|
|
||||||
配布パッケージは DLL のみで完結します。
|
他オブジェクトの値を「現在フレームで事前に算出したスナップショット」を比較する方式から、
|
||||||
|
「参照したオブジェクトを保持し、要求されたフレームで評価する」方式へ統一しました。
|
||||||
|
|
||||||
|
- 取得対象のアイテムを保持し、任意のフレームで評価する `SceneObjectResolver` を追加
|
||||||
|
- スクリプト実行中に行われた参照 `(タグ, フレーム)` を記録し、出力キャッシュの
|
||||||
|
再利用判定では記録した参照を再評価して一致を確認
|
||||||
|
|
||||||
|
これにより、任意フレームの参照に対しても決定論的かつキャッシュ整合性を保った
|
||||||
|
取得が可能になります。評価はすべて描画スレッド側で行い、スクリプト実行スレッドへは
|
||||||
|
数値のみを渡します。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ドキュメント
|
||||||
|
|
||||||
|
対応する 8 言語のスクリプト説明文に `frame` 引数の説明と発射位置を固定する例を
|
||||||
|
追記し、サンプル集ページにも同様の例を追加しました。
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
========================================
|
========================================
|
||||||
Luaスクリプト for YMM4 v1.1.1
|
Luaスクリプト for YMM4 v1.2.0
|
||||||
========================================
|
========================================
|
||||||
YukkuriMovieMaker4(YMM4)上で動作する、Luaスクリプトで映像エフェクトのパラメータや
|
YukkuriMovieMaker4(YMM4)上で動作する、Luaスクリプトで映像エフェクトのパラメータや
|
||||||
ピクセルを直接制御できるプラグインです。
|
ピクセルを直接制御できるプラグインです。
|
||||||
|
|||||||
@@ -42,7 +42,11 @@ namespace LuaScript
|
|||||||
public int Index { get; init; }
|
public int Index { get; init; }
|
||||||
public int Num { get; init; }
|
public int Num { get; init; }
|
||||||
|
|
||||||
public IReadOnlyList<SceneObjectInfo> SceneObjects { get; init; } = [];
|
public SceneObjectResolver? Resolver { get; init; }
|
||||||
|
|
||||||
|
private readonly List<SceneObjectQuery> _objectQueries = [];
|
||||||
|
|
||||||
|
public IReadOnlyList<SceneObjectQuery> ObjectQueries => _objectQueries;
|
||||||
|
|
||||||
public double RxRad => Rx * Math.PI / 180d;
|
public double RxRad => Rx * Math.PI / 180d;
|
||||||
public double RyRad => Ry * Math.PI / 180d;
|
public double RyRad => Ry * Math.PI / 180d;
|
||||||
@@ -83,29 +87,16 @@ namespace LuaScript
|
|||||||
|
|
||||||
internal void MarkPixelsDirty() => _isPixelsDirty = true;
|
internal void MarkPixelsDirty() => _isPixelsDirty = true;
|
||||||
|
|
||||||
public bool TryGetObject(string tag, out SceneObjectInfo info)
|
public bool ResolveObject(string tag, int frame, out SceneObjectInfo info)
|
||||||
{
|
{
|
||||||
SceneObjectInfo? fallback = null;
|
if (Resolver is not null && Resolver.TryResolve(tag, frame, out var resolved))
|
||||||
var objects = SceneObjects;
|
|
||||||
for (int i = 0; i < objects.Count; i++)
|
|
||||||
{
|
{
|
||||||
var candidate = objects[i];
|
_objectQueries.Add(new SceneObjectQuery(tag, frame, resolved));
|
||||||
if (!string.Equals(candidate.Tag, tag, StringComparison.Ordinal))
|
info = resolved;
|
||||||
continue;
|
|
||||||
if (candidate.Exist)
|
|
||||||
{
|
|
||||||
info = candidate;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
fallback ??= candidate;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fallback is { } value)
|
|
||||||
{
|
|
||||||
info = value;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_objectQueries.Add(new SceneObjectQuery(tag, frame, null));
|
||||||
info = default;
|
info = default;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<TargetFramework>net10.0-windows10.0.19041.0</TargetFramework>
|
<TargetFramework>net10.0-windows10.0.19041.0</TargetFramework>
|
||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Version>1.1.1</Version>
|
<Version>1.2.0</Version>
|
||||||
<Platforms>AnyCPU;x64</Platforms>
|
<Platforms>AnyCPU;x64</Platforms>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ namespace LuaScript
|
|||||||
private bool _isFirst = true;
|
private bool _isFirst = true;
|
||||||
private ID2D1Image? _cachedInput;
|
private ID2D1Image? _cachedInput;
|
||||||
private RenderKey _cachedKey;
|
private RenderKey _cachedKey;
|
||||||
private SceneObjectInfo[] _cachedSceneObjects = [];
|
private SceneObjectQuery[] _cachedQueries = [];
|
||||||
private DrawDescription? _cachedOutputDesc;
|
private DrawDescription? _cachedOutputDesc;
|
||||||
private bool _cachedPixelsModified;
|
private bool _cachedPixelsModified;
|
||||||
|
|
||||||
@@ -113,10 +113,10 @@ namespace LuaScript
|
|||||||
desc.TimelineDuration.Time.TotalSeconds,
|
desc.TimelineDuration.Time.TotalSeconds,
|
||||||
inDesc);
|
inDesc);
|
||||||
|
|
||||||
var sceneObjects = BuildSceneObjects(desc);
|
var resolver = BuildSceneObjectResolver(desc);
|
||||||
|
|
||||||
if (!_isFirst && key == _cachedKey &&
|
if (!_isFirst && key == _cachedKey &&
|
||||||
_cachedSceneObjects.AsSpan().SequenceEqual(sceneObjects))
|
QueriesMatch(_cachedQueries, resolver))
|
||||||
{
|
{
|
||||||
effectOutput = _cachedPixelsModified ? _transformEffect?.Output : null;
|
effectOutput = _cachedPixelsModified ? _transformEffect?.Output : null;
|
||||||
return _cachedOutputDesc ?? inDesc;
|
return _cachedOutputDesc ?? inDesc;
|
||||||
@@ -126,7 +126,7 @@ namespace LuaScript
|
|||||||
int imgW = Math.Max(1, (int)Math.Ceiling(bounds.Right - bounds.Left));
|
int imgW = Math.Max(1, (int)Math.Ceiling(bounds.Right - bounds.Left));
|
||||||
int imgH = Math.Max(1, (int)Math.Ceiling(bounds.Bottom - bounds.Top));
|
int imgH = Math.Max(1, (int)Math.Ceiling(bounds.Bottom - bounds.Top));
|
||||||
|
|
||||||
var ctx = BuildContext(in key, imgW, imgH, sceneObjects);
|
var ctx = BuildContext(in key, imgW, imgH, resolver);
|
||||||
ctx.SetPixelLoader(() => LoadInputPixels(bounds, imgW, imgH));
|
ctx.SetPixelLoader(() => LoadInputPixels(bounds, imgW, imgH));
|
||||||
|
|
||||||
DrawDescription outDesc = inDesc;
|
DrawDescription outDesc = inDesc;
|
||||||
@@ -165,18 +165,18 @@ namespace LuaScript
|
|||||||
|
|
||||||
_isFirst = false;
|
_isFirst = false;
|
||||||
_cachedKey = key;
|
_cachedKey = key;
|
||||||
_cachedSceneObjects = sceneObjects;
|
_cachedQueries = [.. ctx.ObjectQueries];
|
||||||
_cachedOutputDesc = outDesc;
|
_cachedOutputDesc = outDesc;
|
||||||
_cachedPixelsModified = pixelsModified;
|
_cachedPixelsModified = pixelsModified;
|
||||||
|
|
||||||
return outDesc;
|
return outDesc;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static SceneObjectInfo[] BuildSceneObjects(EffectDescription desc)
|
private static SceneObjectResolver BuildSceneObjectResolver(EffectDescription desc)
|
||||||
{
|
{
|
||||||
var scenes = desc.Scenes;
|
var scenes = desc.Scenes;
|
||||||
if (scenes is null)
|
if (scenes is null)
|
||||||
return [];
|
return new SceneObjectResolver([], desc.FPS);
|
||||||
|
|
||||||
Scene? scene = null;
|
Scene? scene = null;
|
||||||
foreach (var info in scenes)
|
foreach (var info in scenes)
|
||||||
@@ -188,12 +188,10 @@ namespace LuaScript
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (scene is null)
|
if (scene is null)
|
||||||
return [];
|
return new SceneObjectResolver([], desc.FPS);
|
||||||
|
|
||||||
int timelineFrame = desc.TimelinePosition.Frame;
|
|
||||||
int fps = desc.FPS;
|
|
||||||
var items = scene.Timeline.Items;
|
var items = scene.Timeline.Items;
|
||||||
var result = new List<SceneObjectInfo>(items.Count);
|
var entries = new List<SceneObjectResolver.Entry>(items.Count);
|
||||||
|
|
||||||
foreach (var item in items)
|
foreach (var item in items)
|
||||||
{
|
{
|
||||||
@@ -203,30 +201,25 @@ namespace LuaScript
|
|||||||
if (string.IsNullOrEmpty(tag))
|
if (string.IsNullOrEmpty(tag))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int length = item.Length;
|
entries.Add(new SceneObjectResolver.Entry(tag, item.Frame, item.Length, item.Layer, visual));
|
||||||
int local = Math.Clamp(timelineFrame - item.Frame, 0, length);
|
|
||||||
bool exist = item.Frame <= timelineFrame && timelineFrame < item.Frame + length;
|
|
||||||
|
|
||||||
double x = visual.X.GetValue(local, length, fps);
|
|
||||||
double y = visual.Y.GetValue(local, length, fps);
|
|
||||||
double z = visual.Z.GetValue(local, length, fps);
|
|
||||||
double zoom = visual.Zoom.GetValue(local, length, fps) / 100d;
|
|
||||||
double rz = visual.Rotation.GetValue(local, length, fps);
|
|
||||||
|
|
||||||
double opacity = visual.Opacity.GetValue(local, length, fps) / 100d;
|
|
||||||
double timeSec = fps > 0 ? local / (double)fps : 0d;
|
|
||||||
double durationSec = fps > 0 ? length / (double)fps : 0d;
|
|
||||||
double fadeIn = visual.FadeIn <= 0d ? 1d : Math.Min(1d, timeSec / visual.FadeIn);
|
|
||||||
double fadeOut = visual.FadeOut <= 0d ? 1d : Math.Min(1d, (durationSec - timeSec) / visual.FadeOut);
|
|
||||||
double alpha = opacity * Math.Min(fadeIn, fadeOut) * 255d;
|
|
||||||
|
|
||||||
result.Add(new SceneObjectInfo(tag, exist, x, y, z, zoom, rz, alpha, item.Layer));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return [.. result];
|
return new SceneObjectResolver([.. entries], desc.FPS);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static AviUtlScriptContext BuildContext(in RenderKey key, int imgW, int imgH, SceneObjectInfo[] sceneObjects)
|
private static bool QueriesMatch(SceneObjectQuery[] queries, SceneObjectResolver resolver)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < queries.Length; i++)
|
||||||
|
{
|
||||||
|
var query = queries[i];
|
||||||
|
SceneObjectInfo? current = resolver.TryResolve(query.Tag, query.Frame, out var info) ? info : null;
|
||||||
|
if (!Nullable.Equals(current, query.Result))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static AviUtlScriptContext BuildContext(in RenderKey key, int imgW, int imgH, SceneObjectResolver resolver)
|
||||||
{
|
{
|
||||||
var zoom = key.InputDesc.Zoom;
|
var zoom = key.InputDesc.Zoom;
|
||||||
double zoomAvg = (zoom.X + zoom.Y) / 2d;
|
double zoomAvg = (zoom.X + zoom.Y) / 2d;
|
||||||
@@ -277,7 +270,7 @@ namespace LuaScript
|
|||||||
IsPaused = key.Usage == TimelineSourceUsage.Paused,
|
IsPaused = key.Usage == TimelineSourceUsage.Paused,
|
||||||
SceneId = key.SceneId.ToString(),
|
SceneId = key.SceneId.ToString(),
|
||||||
TimeRatio = key.Length > 0 ? key.Frame / (double)key.Length : 0d,
|
TimeRatio = key.Length > 0 ? key.Frame / (double)key.Length : 0d,
|
||||||
SceneObjects = sceneObjects,
|
Resolver = resolver,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -407,7 +407,15 @@ namespace LuaScript
|
|||||||
var tag = args[0];
|
var tag = args[0];
|
||||||
if (tag.Type != DataType.String)
|
if (tag.Type != DataType.String)
|
||||||
return DynValue.Nil;
|
return DynValue.Nil;
|
||||||
if (!_activeContext.TryGetObject(tag.String, out var info))
|
int frame = _activeContext.TimelineFrame;
|
||||||
|
if (args.Count >= 2)
|
||||||
|
{
|
||||||
|
var frameArg = args[1];
|
||||||
|
if (frameArg.Type != DataType.Number)
|
||||||
|
return DynValue.Nil;
|
||||||
|
frame = (int)frameArg.Number;
|
||||||
|
}
|
||||||
|
if (!_activeContext.ResolveObject(tag.String, frame, out var info))
|
||||||
return DynValue.Nil;
|
return DynValue.Nil;
|
||||||
return BuildObjectTable(execCtx.GetScript(), info);
|
return BuildObjectTable(execCtx.GetScript(), info);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -10,4 +10,9 @@ namespace LuaScript
|
|||||||
double Rz,
|
double Rz,
|
||||||
double Alpha,
|
double Alpha,
|
||||||
int Layer);
|
int Layer);
|
||||||
|
|
||||||
|
internal readonly record struct SceneObjectQuery(
|
||||||
|
string Tag,
|
||||||
|
int Frame,
|
||||||
|
SceneObjectInfo? Result);
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
using YukkuriMovieMaker.Project.Items;
|
||||||
|
|
||||||
|
namespace LuaScript
|
||||||
|
{
|
||||||
|
internal sealed class SceneObjectResolver
|
||||||
|
{
|
||||||
|
internal readonly record struct Entry(string Tag, int Frame, int Length, int Layer, VisualItem Item);
|
||||||
|
|
||||||
|
private readonly Entry[] _entries;
|
||||||
|
private readonly int _fps;
|
||||||
|
|
||||||
|
internal SceneObjectResolver(Entry[] entries, int fps)
|
||||||
|
{
|
||||||
|
_entries = entries;
|
||||||
|
_fps = fps;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal bool TryResolve(string tag, int timelineFrame, out SceneObjectInfo info)
|
||||||
|
{
|
||||||
|
int fallback = -1;
|
||||||
|
for (int i = 0; i < _entries.Length; i++)
|
||||||
|
{
|
||||||
|
if (!string.Equals(_entries[i].Tag, tag, StringComparison.Ordinal))
|
||||||
|
continue;
|
||||||
|
if (IsExist(_entries[i], timelineFrame))
|
||||||
|
{
|
||||||
|
info = Evaluate(_entries[i], timelineFrame);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (fallback < 0)
|
||||||
|
fallback = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fallback >= 0)
|
||||||
|
{
|
||||||
|
info = Evaluate(_entries[fallback], timelineFrame);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
info = default;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool IsExist(in Entry entry, int timelineFrame)
|
||||||
|
=> entry.Frame <= timelineFrame && timelineFrame < entry.Frame + entry.Length;
|
||||||
|
|
||||||
|
private SceneObjectInfo Evaluate(in Entry entry, int timelineFrame)
|
||||||
|
{
|
||||||
|
var visual = entry.Item;
|
||||||
|
int length = entry.Length;
|
||||||
|
int local = Math.Clamp(timelineFrame - entry.Frame, 0, length);
|
||||||
|
|
||||||
|
double x = visual.X.GetValue(local, length, _fps);
|
||||||
|
double y = visual.Y.GetValue(local, length, _fps);
|
||||||
|
double z = visual.Z.GetValue(local, length, _fps);
|
||||||
|
double zoom = visual.Zoom.GetValue(local, length, _fps) / 100d;
|
||||||
|
double rz = visual.Rotation.GetValue(local, length, _fps);
|
||||||
|
|
||||||
|
double opacity = visual.Opacity.GetValue(local, length, _fps) / 100d;
|
||||||
|
double timeSec = _fps > 0 ? local / (double)_fps : 0d;
|
||||||
|
double durationSec = _fps > 0 ? length / (double)_fps : 0d;
|
||||||
|
double fadeIn = visual.FadeIn <= 0d ? 1d : Math.Min(1d, timeSec / visual.FadeIn);
|
||||||
|
double fadeOut = visual.FadeOut <= 0d ? 1d : Math.Min(1d, (durationSec - timeSec) / visual.FadeOut);
|
||||||
|
double alpha = opacity * Math.Min(fadeIn, fadeOut) * 255d;
|
||||||
|
|
||||||
|
return new SceneObjectInfo(entry.Tag, IsExist(entry, timelineFrame), x, y, z, zoom, rz, alpha, entry.Layer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -189,20 +189,23 @@
|
|||||||
|
|
||||||
- جدول obj - الدوال -
|
- جدول obj - الدوال -
|
||||||
|
|
||||||
○ obj.getobject(tag)
|
○ obj.getobject(tag [, frame])
|
||||||
يحصل على معلومات الرسم الحالية لكائن آخر يحمل الوسم المحدد.
|
يحصل على معلومات الرسم لكائن آخر يحمل الوسم المحدد.
|
||||||
※ يطابق الوسم النص المُدخل في حقل "ملاحظة (Remark)" للعنصر الهدف.
|
※ يطابق الوسم النص المُدخل في حقل "ملاحظة" للعنصر الهدف.
|
||||||
|
※ عند تمرير الوسيط الثاني frame تُؤخذ القيم عند ذلك الإطار من
|
||||||
|
المخطط الزمني. وعند حذفه يُستخدم الإطار الحالي.
|
||||||
※ عند وجود عدة عناصر تحمل الوسم نفسه، يُعاد العنصر الظاهر في
|
※ عند وجود عدة عناصر تحمل الوسم نفسه، يُعاد العنصر الظاهر في
|
||||||
الإطار الحالي بأولوية. وإن لم يكن أي منها ظاهرًا، يُعاد أول
|
الإطار الهدف بأولوية. وإن لم يكن أي منها ظاهرًا، يُعاد أول
|
||||||
عنصر مطابق.
|
عنصر مطابق.
|
||||||
※ القيم المُعادة هي إحداثيات العنصر ودورانه ومقياسه الخاصة به.
|
※ القيم المُعادة هي إحداثيات العنصر ودورانه ومقياسه الخاصة به.
|
||||||
ولا تتضمن التحويلات الناتجة عن التحكم بالمجموعة أو التحكم
|
ولا تتضمن التحويلات الناتجة عن التحكم بالمجموعة أو التحكم
|
||||||
بالكاميرا أو التأثيرات الأعلى.
|
بالكاميرا أو التأثيرات الأعلى.
|
||||||
※ تستخدم كل قيمة نظام الوحدات نفسه المستخدم في جدول obj.
|
※ تستخدم كل قيمة نظام الوحدات نفسه المستخدم في جدول obj.
|
||||||
tag : النص المضبوط في ملاحظة العنصر الهدف
|
tag : النص المضبوط في ملاحظة العنصر الهدف
|
||||||
|
frame : الإطار المطلق على المخطط الزمني المراد أخذه (اختياري)
|
||||||
القيمة المُعادة : جدول معلومات الكائن. يُعيد nil عند عدم وجود
|
القيمة المُعادة : جدول معلومات الكائن. يُعيد nil عند عدم وجود
|
||||||
عنصر مطابق.
|
عنصر مطابق.
|
||||||
.exist : هل هو ظاهر في الإطار الحالي (boolean)
|
.exist : هل هو ظاهر في الإطار الهدف (boolean)
|
||||||
.x : إحداثي العرض الأساسي X
|
.x : إحداثي العرض الأساسي X
|
||||||
.y : إحداثي العرض الأساسي Y
|
.y : إحداثي العرض الأساسي Y
|
||||||
.z : إحداثي العرض الأساسي Z
|
.z : إحداثي العرض الأساسي Z
|
||||||
@@ -223,6 +226,13 @@
|
|||||||
obj.x = funnel.x
|
obj.x = funnel.x
|
||||||
obj.y = funnel.y
|
obj.y = funnel.y
|
||||||
end
|
end
|
||||||
|
التثبيت على موضع الإطلاق (ملاحظة المُطلِق هي "funnel"):
|
||||||
|
local fire = timelineframe - frame
|
||||||
|
local src = obj.getobject("funnel", fire)
|
||||||
|
if src then
|
||||||
|
obj.x = src.x
|
||||||
|
obj.y = src.y
|
||||||
|
end
|
||||||
|
|
||||||
○ obj.getpixel(x, y)
|
○ obj.getpixel(x, y)
|
||||||
يسترد معلومات البكسل عند الإحداثيات المحددة.
|
يسترد معلومات البكسل عند الإحداثيات المحددة.
|
||||||
|
|||||||
@@ -192,22 +192,26 @@
|
|||||||
|
|
||||||
- obj Table - Functions -
|
- obj Table - Functions -
|
||||||
|
|
||||||
o obj.getobject(tag)
|
o obj.getobject(tag [, frame])
|
||||||
Gets the current drawing information of another object that has
|
Gets the drawing information of another object that has the
|
||||||
the specified tag.
|
specified tag.
|
||||||
* The tag matches the string entered in the target item's
|
* The tag matches the string entered in the target item's
|
||||||
"Remark" field.
|
"Remark" field.
|
||||||
* If multiple items share the same tag, the item currently
|
* When the second argument frame is given, the values at that
|
||||||
visible at the present frame is returned with priority.
|
timeline frame are returned. When omitted, the current frame
|
||||||
If none is visible, the first matching item is returned.
|
is used.
|
||||||
|
* If multiple items share the same tag, the item visible at the
|
||||||
|
target frame is returned with priority. If none is visible,
|
||||||
|
the first matching item is returned.
|
||||||
* The returned values are the item's own coordinates, rotation
|
* The returned values are the item's own coordinates, rotation
|
||||||
and scale. Transforms from group control, camera control or
|
and scale. Transforms from group control, camera control or
|
||||||
upper effects are NOT included.
|
upper effects are NOT included.
|
||||||
* Each value uses the same unit system as the obj table.
|
* Each value uses the same unit system as the obj table.
|
||||||
tag : The string set in the target item's remark
|
tag : The string set in the target item's remark
|
||||||
|
frame : The absolute timeline frame to sample (optional)
|
||||||
Return : An object information table. Returns nil when no
|
Return : An object information table. Returns nil when no
|
||||||
matching item exists.
|
matching item exists.
|
||||||
.exist : Whether it is visible at the current frame (boolean)
|
.exist : Whether it is visible at the target frame (boolean)
|
||||||
.x : Display base coordinate X
|
.x : Display base coordinate X
|
||||||
.y : Display base coordinate Y
|
.y : Display base coordinate Y
|
||||||
.z : Display base coordinate Z
|
.z : Display base coordinate Z
|
||||||
@@ -228,6 +232,13 @@
|
|||||||
obj.x = funnel.x
|
obj.x = funnel.x
|
||||||
obj.y = funnel.y
|
obj.y = funnel.y
|
||||||
end
|
end
|
||||||
|
Locking to the firing position (emitter remark is "funnel"):
|
||||||
|
local fire = timelineframe - frame
|
||||||
|
local src = obj.getobject("funnel", fire)
|
||||||
|
if src then
|
||||||
|
obj.x = src.x
|
||||||
|
obj.y = src.y
|
||||||
|
end
|
||||||
|
|
||||||
o obj.getpixel(x, y)
|
o obj.getpixel(x, y)
|
||||||
Retrieves pixel information at the specified coordinates.
|
Retrieves pixel information at the specified coordinates.
|
||||||
|
|||||||
@@ -189,13 +189,16 @@
|
|||||||
|
|
||||||
- Tabla obj - Funciones -
|
- Tabla obj - Funciones -
|
||||||
|
|
||||||
o obj.getobject(tag)
|
o obj.getobject(tag [, frame])
|
||||||
Obtiene la información de dibujo actual de otro objeto que tiene
|
Obtiene la información de dibujo de otro objeto que tiene la
|
||||||
la etiqueta especificada.
|
etiqueta especificada.
|
||||||
* La etiqueta coincide con el texto introducido en el campo
|
* La etiqueta coincide con el texto introducido en el campo
|
||||||
"Observación (Remark)" del elemento de destino.
|
"Observación" del elemento de destino.
|
||||||
|
* Si se indica el segundo argumento frame, se obtienen los
|
||||||
|
valores en ese fotograma de la línea de tiempo. Si se omite,
|
||||||
|
se usa el fotograma actual.
|
||||||
* Si varios elementos comparten la misma etiqueta, se devuelve
|
* Si varios elementos comparten la misma etiqueta, se devuelve
|
||||||
con prioridad el elemento visible en el fotograma actual.
|
con prioridad el elemento visible en el fotograma de destino.
|
||||||
Si ninguno es visible, se devuelve el primer elemento que
|
Si ninguno es visible, se devuelve el primer elemento que
|
||||||
coincida.
|
coincida.
|
||||||
* Los valores devueltos son las coordenadas, rotación y escala
|
* Los valores devueltos son las coordenadas, rotación y escala
|
||||||
@@ -203,9 +206,10 @@
|
|||||||
control de grupo, control de cámara o efectos superiores.
|
control de grupo, control de cámara o efectos superiores.
|
||||||
* Cada valor usa el mismo sistema de unidades que la tabla obj.
|
* Cada valor usa el mismo sistema de unidades que la tabla obj.
|
||||||
tag : El texto definido en la observación del elemento de destino
|
tag : El texto definido en la observación del elemento de destino
|
||||||
|
frame : El fotograma absoluto de la línea de tiempo (opcional)
|
||||||
Retorno : Una tabla de información del objeto. Devuelve nil cuando
|
Retorno : Una tabla de información del objeto. Devuelve nil cuando
|
||||||
no existe ningún elemento coincidente.
|
no existe ningún elemento coincidente.
|
||||||
.exist : Si es visible en el fotograma actual (boolean)
|
.exist : Si es visible en el fotograma de destino (boolean)
|
||||||
.x : Coordenada base de visualización X
|
.x : Coordenada base de visualización X
|
||||||
.y : Coordenada base de visualización Y
|
.y : Coordenada base de visualización Y
|
||||||
.z : Coordenada base de visualización Z
|
.z : Coordenada base de visualización Z
|
||||||
@@ -226,6 +230,13 @@
|
|||||||
obj.x = funnel.x
|
obj.x = funnel.x
|
||||||
obj.y = funnel.y
|
obj.y = funnel.y
|
||||||
end
|
end
|
||||||
|
Fijar a la posición de disparo (la observación del emisor es "funnel"):
|
||||||
|
local fire = timelineframe - frame
|
||||||
|
local src = obj.getobject("funnel", fire)
|
||||||
|
if src then
|
||||||
|
obj.x = src.x
|
||||||
|
obj.y = src.y
|
||||||
|
end
|
||||||
|
|
||||||
o obj.getpixel(x, y)
|
o obj.getpixel(x, y)
|
||||||
Obtiene información del píxel en las coordenadas especificadas.
|
Obtiene información del píxel en las coordenadas especificadas.
|
||||||
|
|||||||
@@ -189,23 +189,25 @@
|
|||||||
|
|
||||||
- Tabel obj - Fungsi -
|
- Tabel obj - Fungsi -
|
||||||
|
|
||||||
o obj.getobject(tag)
|
o obj.getobject(tag [, frame])
|
||||||
Mengambil informasi gambar terkini dari objek lain yang memiliki
|
Mengambil informasi gambar dari objek lain yang memiliki tag
|
||||||
tag yang ditentukan.
|
yang ditentukan.
|
||||||
* Tag cocok dengan teks yang dimasukkan pada kolom
|
* Tag cocok dengan teks yang dimasukkan pada kolom
|
||||||
"Catatan (Remark)" item target.
|
"Catatan" item target.
|
||||||
* Jika beberapa item berbagi tag yang sama, item yang sedang
|
* Jika argumen kedua frame diberikan, nilai pada frame tersebut
|
||||||
tampil pada frame saat ini dikembalikan dengan prioritas.
|
di lini masa diambil. Jika dihilangkan, frame saat ini dipakai.
|
||||||
Jika tidak ada yang tampil, item pertama yang cocok
|
* Jika beberapa item berbagi tag yang sama, item yang tampil
|
||||||
dikembalikan.
|
pada frame target dikembalikan dengan prioritas. Jika tidak
|
||||||
|
ada yang tampil, item pertama yang cocok dikembalikan.
|
||||||
* Nilai yang dikembalikan adalah koordinat, rotasi, dan skala
|
* Nilai yang dikembalikan adalah koordinat, rotasi, dan skala
|
||||||
milik item itu sendiri. Transformasi dari kontrol grup,
|
milik item itu sendiri. Transformasi dari kontrol grup,
|
||||||
kontrol kamera, atau efek di atasnya TIDAK disertakan.
|
kontrol kamera, atau efek di atasnya TIDAK disertakan.
|
||||||
* Setiap nilai menggunakan sistem satuan yang sama dengan tabel obj.
|
* Setiap nilai menggunakan sistem satuan yang sama dengan tabel obj.
|
||||||
tag : Teks yang diatur pada catatan item target
|
tag : Teks yang diatur pada catatan item target
|
||||||
|
frame : Frame absolut pada lini masa yang diambil (opsional)
|
||||||
Kembali : Tabel informasi objek. Mengembalikan nil jika tidak ada
|
Kembali : Tabel informasi objek. Mengembalikan nil jika tidak ada
|
||||||
item yang cocok.
|
item yang cocok.
|
||||||
.exist : Apakah tampil pada frame saat ini (boolean)
|
.exist : Apakah tampil pada frame target (boolean)
|
||||||
.x : Koordinat dasar tampilan X
|
.x : Koordinat dasar tampilan X
|
||||||
.y : Koordinat dasar tampilan Y
|
.y : Koordinat dasar tampilan Y
|
||||||
.z : Koordinat dasar tampilan Z
|
.z : Koordinat dasar tampilan Z
|
||||||
@@ -226,6 +228,13 @@
|
|||||||
obj.x = funnel.x
|
obj.x = funnel.x
|
||||||
obj.y = funnel.y
|
obj.y = funnel.y
|
||||||
end
|
end
|
||||||
|
Mengunci ke posisi penembakan (catatan emitor adalah "funnel"):
|
||||||
|
local fire = timelineframe - frame
|
||||||
|
local src = obj.getobject("funnel", fire)
|
||||||
|
if src then
|
||||||
|
obj.x = src.x
|
||||||
|
obj.y = src.y
|
||||||
|
end
|
||||||
|
|
||||||
o obj.getpixel(x, y)
|
o obj.getpixel(x, y)
|
||||||
Mengambil informasi piksel pada koordinat yang ditentukan.
|
Mengambil informasi piksel pada koordinat yang ditentukan.
|
||||||
|
|||||||
@@ -192,19 +192,22 @@
|
|||||||
|
|
||||||
- obj テーブル - 関数 -
|
- obj テーブル - 関数 -
|
||||||
|
|
||||||
○obj.getobject(tag)
|
○obj.getobject(tag [, frame])
|
||||||
指定したタグを持つ他のオブジェクトの現在の描画情報を取得します。
|
指定したタグを持つ他のオブジェクトの描画情報を取得します。
|
||||||
※ タグは対象アイテムの「備考」に入力した文字列と一致します。
|
※ タグは対象アイテムの「備考」に入力した文字列と一致します。
|
||||||
※ 同じタグを持つアイテムが複数ある場合、現在のフレームで表示中の
|
※ 第2引数 frame を指定すると、そのタイムラインフレーム時点の値を
|
||||||
|
取得します。省略時は現在フレームの値を取得します。
|
||||||
|
※ 同じタグを持つアイテムが複数ある場合、対象フレームで表示中の
|
||||||
アイテムを優先して返します。表示中のものが無い場合は最初に
|
アイテムを優先して返します。表示中のものが無い場合は最初に
|
||||||
一致したアイテムを返します。
|
一致したアイテムを返します。
|
||||||
※ 取得できる値はアイテム自身の座標・回転・拡大率です。
|
※ 取得できる値はアイテム自身の座標・回転・拡大率です。
|
||||||
グループ制御・カメラ制御・上位エフェクトによる変形は含まれません。
|
グループ制御・カメラ制御・上位エフェクトによる変形は含まれません。
|
||||||
※ 各値は obj テーブルと同一の単位系です。
|
※ 各値は obj テーブルと同一の単位系です。
|
||||||
tag : 対象アイテムの備考に設定した文字列
|
tag : 対象アイテムの備考に設定した文字列
|
||||||
|
frame : 取得するタイムライン上の絶対フレーム (省略可)
|
||||||
戻り値 : オブジェクト情報テーブル。一致するアイテムが存在しない場合は
|
戻り値 : オブジェクト情報テーブル。一致するアイテムが存在しない場合は
|
||||||
nil を返します。
|
nil を返します。
|
||||||
.exist : 現在のフレームで表示中かどうか (boolean)
|
.exist : 対象フレームで表示中かどうか (boolean)
|
||||||
.x : 表示基準座標 X
|
.x : 表示基準座標 X
|
||||||
.y : 表示基準座標 Y
|
.y : 表示基準座標 Y
|
||||||
.z : 表示基準座標 Z
|
.z : 表示基準座標 Z
|
||||||
@@ -225,6 +228,13 @@
|
|||||||
obj.x = funnel.x
|
obj.x = funnel.x
|
||||||
obj.y = funnel.y
|
obj.y = funnel.y
|
||||||
end
|
end
|
||||||
|
発射時の座標に固定する例 (発射元の備考が "funnel" の場合):
|
||||||
|
local fire = timelineframe - frame
|
||||||
|
local src = obj.getobject("funnel", fire)
|
||||||
|
if src then
|
||||||
|
obj.x = src.x
|
||||||
|
obj.y = src.y
|
||||||
|
end
|
||||||
|
|
||||||
○obj.getpixel(x, y)
|
○obj.getpixel(x, y)
|
||||||
指定座標のピクセル情報を取得します。
|
指定座標のピクセル情報を取得します。
|
||||||
|
|||||||
@@ -189,18 +189,21 @@
|
|||||||
|
|
||||||
- obj 테이블 - 함수 -
|
- obj 테이블 - 함수 -
|
||||||
|
|
||||||
○ obj.getobject(tag)
|
○ obj.getobject(tag [, frame])
|
||||||
지정한 태그를 가진 다른 오브젝트의 현재 그리기 정보를 취득합니다.
|
지정한 태그를 가진 다른 오브젝트의 그리기 정보를 취득합니다.
|
||||||
※ 태그는 대상 아이템의 "비고(Remark)"에 입력한 문자열과 일치합니다.
|
※ 태그는 대상 아이템의 "비고"에 입력한 문자열과 일치합니다.
|
||||||
※ 같은 태그를 가진 아이템이 여러 개인 경우, 현재 프레임에서
|
※ 두 번째 인수 frame을 지정하면 해당 타임라인 프레임 시점의 값을
|
||||||
|
취득합니다. 생략하면 현재 프레임의 값을 취득합니다.
|
||||||
|
※ 같은 태그를 가진 아이템이 여러 개인 경우, 대상 프레임에서
|
||||||
표시 중인 아이템을 우선하여 반환합니다. 표시 중인 것이 없으면
|
표시 중인 아이템을 우선하여 반환합니다. 표시 중인 것이 없으면
|
||||||
처음으로 일치한 아이템을 반환합니다.
|
처음으로 일치한 아이템을 반환합니다.
|
||||||
※ 취득되는 값은 아이템 자신의 좌표·회전·확대율입니다.
|
※ 취득되는 값은 아이템 자신의 좌표·회전·확대율입니다.
|
||||||
그룹 제어·카메라 제어·상위 이펙트에 의한 변형은 포함되지 않습니다.
|
그룹 제어·카메라 제어·상위 이펙트에 의한 변형은 포함되지 않습니다.
|
||||||
※ 각 값은 obj 테이블과 동일한 단위 체계입니다.
|
※ 각 값은 obj 테이블과 동일한 단위 체계입니다.
|
||||||
tag : 대상 아이템의 비고에 설정한 문자열
|
tag : 대상 아이템의 비고에 설정한 문자열
|
||||||
|
frame : 취득할 타임라인의 절대 프레임 (생략 가능)
|
||||||
반환값 : 오브젝트 정보 테이블. 일치하는 아이템이 없으면 nil을 반환합니다.
|
반환값 : 오브젝트 정보 테이블. 일치하는 아이템이 없으면 nil을 반환합니다.
|
||||||
.exist : 현재 프레임에서 표시 중인지 여부 (boolean)
|
.exist : 대상 프레임에서 표시 중인지 여부 (boolean)
|
||||||
.x : 표시 기준 좌표 X
|
.x : 표시 기준 좌표 X
|
||||||
.y : 표시 기준 좌표 Y
|
.y : 표시 기준 좌표 Y
|
||||||
.z : 표시 기준 좌표 Z
|
.z : 표시 기준 좌표 Z
|
||||||
@@ -221,6 +224,13 @@
|
|||||||
obj.x = funnel.x
|
obj.x = funnel.x
|
||||||
obj.y = funnel.y
|
obj.y = funnel.y
|
||||||
end
|
end
|
||||||
|
발사 시 좌표로 고정하는 예 (발사원의 비고가 "funnel"인 경우):
|
||||||
|
local fire = timelineframe - frame
|
||||||
|
local src = obj.getobject("funnel", fire)
|
||||||
|
if src then
|
||||||
|
obj.x = src.x
|
||||||
|
obj.y = src.y
|
||||||
|
end
|
||||||
|
|
||||||
○ obj.getpixel(x, y)
|
○ obj.getpixel(x, y)
|
||||||
지정 좌표의 픽셀 정보를 취득합니다.
|
지정 좌표의 픽셀 정보를 취득합니다.
|
||||||
|
|||||||
@@ -189,17 +189,19 @@
|
|||||||
|
|
||||||
- obj 表 - 函数 -
|
- obj 表 - 函数 -
|
||||||
|
|
||||||
○ obj.getobject(tag)
|
○ obj.getobject(tag [, frame])
|
||||||
获取具有指定标签的其他对象的当前绘制信息。
|
获取具有指定标签的其他对象的绘制信息。
|
||||||
※ 标签与目标项目“备注(Remark)”中输入的字符串相匹配。
|
※ 标签与目标项目“备注”中输入的字符串相匹配。
|
||||||
※ 当多个项目拥有相同标签时,优先返回在当前帧显示中的项目。
|
※ 指定第二个参数 frame 时,获取该时间轴帧的数值。省略时获取当前帧。
|
||||||
|
※ 当多个项目拥有相同标签时,优先返回在目标帧显示中的项目。
|
||||||
若没有显示中的项目,则返回第一个匹配的项目。
|
若没有显示中的项目,则返回第一个匹配的项目。
|
||||||
※ 获取的值是项目自身的坐标、旋转和缩放。
|
※ 获取的值是项目自身的坐标、旋转和缩放。
|
||||||
不包含组控制、摄像机控制以及上层特效造成的变换。
|
不包含组控制、摄像机控制以及上层特效造成的变换。
|
||||||
※ 各数值使用与 obj 表相同的单位体系。
|
※ 各数值使用与 obj 表相同的单位体系。
|
||||||
tag : 设置在目标项目备注中的字符串
|
tag : 设置在目标项目备注中的字符串
|
||||||
|
frame : 要获取的时间轴绝对帧 (可省略)
|
||||||
返回值 : 对象信息表。当不存在匹配项目时返回 nil。
|
返回值 : 对象信息表。当不存在匹配项目时返回 nil。
|
||||||
.exist : 是否在当前帧显示中 (boolean)
|
.exist : 是否在目标帧显示中 (boolean)
|
||||||
.x : 显示基准坐标 X
|
.x : 显示基准坐标 X
|
||||||
.y : 显示基准坐标 Y
|
.y : 显示基准坐标 Y
|
||||||
.z : 显示基准坐标 Z
|
.z : 显示基准坐标 Z
|
||||||
@@ -220,6 +222,13 @@
|
|||||||
obj.x = funnel.x
|
obj.x = funnel.x
|
||||||
obj.y = funnel.y
|
obj.y = funnel.y
|
||||||
end
|
end
|
||||||
|
固定为发射时坐标的示例 (发射源备注为 "funnel"):
|
||||||
|
local fire = timelineframe - frame
|
||||||
|
local src = obj.getobject("funnel", fire)
|
||||||
|
if src then
|
||||||
|
obj.x = src.x
|
||||||
|
obj.y = src.y
|
||||||
|
end
|
||||||
|
|
||||||
○ obj.getpixel(x, y)
|
○ obj.getpixel(x, y)
|
||||||
获取指定坐标的像素信息。
|
获取指定坐标的像素信息。
|
||||||
|
|||||||
@@ -189,17 +189,19 @@
|
|||||||
|
|
||||||
- obj 表 - 函式 -
|
- obj 表 - 函式 -
|
||||||
|
|
||||||
○ obj.getobject(tag)
|
○ obj.getobject(tag [, frame])
|
||||||
取得具有指定標籤的其他物件的目前繪製資訊。
|
取得具有指定標籤的其他物件的繪製資訊。
|
||||||
※ 標籤與目標項目「備註(Remark)」中輸入的字串相符。
|
※ 標籤與目標項目「備註」中輸入的字串相符。
|
||||||
※ 當多個項目擁有相同標籤時,優先回傳在目前影格顯示中的項目。
|
※ 指定第二個參數 frame 時,取得該時間軸影格的數值。省略時取得目前影格。
|
||||||
|
※ 當多個項目擁有相同標籤時,優先回傳在目標影格顯示中的項目。
|
||||||
若沒有顯示中的項目,則回傳第一個相符的項目。
|
若沒有顯示中的項目,則回傳第一個相符的項目。
|
||||||
※ 取得的值是項目自身的座標、旋轉與縮放。
|
※ 取得的值是項目自身的座標、旋轉與縮放。
|
||||||
不包含群組控制、攝影機控制以及上層特效造成的變換。
|
不包含群組控制、攝影機控制以及上層特效造成的變換。
|
||||||
※ 各數值使用與 obj 表相同的單位體系。
|
※ 各數值使用與 obj 表相同的單位體系。
|
||||||
tag : 設定於目標項目備註中的字串
|
tag : 設定於目標項目備註中的字串
|
||||||
|
frame : 要取得的時間軸絕對影格 (可省略)
|
||||||
回傳值 : 物件資訊表。當不存在相符項目時回傳 nil。
|
回傳值 : 物件資訊表。當不存在相符項目時回傳 nil。
|
||||||
.exist : 是否在目前影格顯示中 (boolean)
|
.exist : 是否在目標影格顯示中 (boolean)
|
||||||
.x : 顯示基準座標 X
|
.x : 顯示基準座標 X
|
||||||
.y : 顯示基準座標 Y
|
.y : 顯示基準座標 Y
|
||||||
.z : 顯示基準座標 Z
|
.z : 顯示基準座標 Z
|
||||||
@@ -220,6 +222,13 @@
|
|||||||
obj.x = funnel.x
|
obj.x = funnel.x
|
||||||
obj.y = funnel.y
|
obj.y = funnel.y
|
||||||
end
|
end
|
||||||
|
固定為發射時座標的範例 (發射來源備註為 "funnel"):
|
||||||
|
local fire = timelineframe - frame
|
||||||
|
local src = obj.getobject("funnel", fire)
|
||||||
|
if src then
|
||||||
|
obj.x = src.x
|
||||||
|
obj.y = src.y
|
||||||
|
end
|
||||||
|
|
||||||
○ obj.getpixel(x, y)
|
○ obj.getpixel(x, y)
|
||||||
取得指定座標的像素資訊。
|
取得指定座標的像素資訊。
|
||||||
|
|||||||
+22
-7
@@ -308,11 +308,13 @@ end</code></pre>
|
|||||||
<h2 id="getobject">12. 他オブジェクトの参照 (obj.getobject)</h2>
|
<h2 id="getobject">12. 他オブジェクトの参照 (obj.getobject)</h2>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<code>obj.getobject(tag)</code> は、対象アイテムの「備考」欄に入力した文字列をタグとして、
|
<code>obj.getobject(tag [, frame])</code> は、対象アイテムの「備考」欄に入力した文字列を
|
||||||
そのアイテムの描画情報を取得します。備考欄はプロパティエリアの上側にあります。
|
タグとして、そのアイテムの描画情報を取得します。備考欄はプロパティエリアの上側にあります。
|
||||||
返り値は対象アイテム自身の座標・回転・拡大率であり、グループ制御・カメラ制御による
|
第2引数 <code>frame</code> を指定すると、そのタイムラインフレーム時点の値を取得します
|
||||||
変形は含みません。一致するアイテムが無い場合は <code>nil</code> を返します。
|
(省略時は現在フレーム)。返り値は対象アイテム自身の座標・回転・拡大率であり、
|
||||||
同じタグのアイテムが複数あるときは、現在フレームで表示中のものを優先します。
|
グループ制御・カメラ制御による変形は含みません。一致するアイテムが無い場合は
|
||||||
|
<code>nil</code> を返します。同じタグのアイテムが複数あるときは、対象フレームで
|
||||||
|
表示中のものを優先します。
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h3>12-1. 発射元の座標に合わせる</h3>
|
<h3>12-1. 発射元の座標に合わせる</h3>
|
||||||
@@ -371,10 +373,23 @@ if src then
|
|||||||
obj.alpha = src.alpha
|
obj.alpha = src.alpha
|
||||||
end</code></pre>
|
end</code></pre>
|
||||||
|
|
||||||
|
<h3>12-7. 発射時の座標に固定する</h3>
|
||||||
|
<p>
|
||||||
|
弾の発射フレーム (弾アイテムの開始フレーム) は <code>timelineframe - frame</code> で
|
||||||
|
求まります。そのフレーム時点の発射元座標を取得すれば、発射元が動いても弾の原点は
|
||||||
|
発射位置に固定されます。
|
||||||
|
</p>
|
||||||
|
<pre><code>local fire = timelineframe - frame
|
||||||
|
local src = obj.getobject("routersys", fire)
|
||||||
|
if src then
|
||||||
|
obj.x = src.x
|
||||||
|
obj.y = src.y
|
||||||
|
end</code></pre>
|
||||||
|
|
||||||
<p>返り値テーブルのメンバーは以下のとおりです。</p>
|
<p>返り値テーブルのメンバーは以下のとおりです。</p>
|
||||||
<table border="1">
|
<table border="1">
|
||||||
<tr><th>メンバー</th><th>説明</th></tr>
|
<tr><th>メンバー</th><th>説明</th></tr>
|
||||||
<tr><td>exist</td><td>現在フレームが表示期間内か (boolean)</td></tr>
|
<tr><td>exist</td><td>対象フレームが表示期間内か (boolean)</td></tr>
|
||||||
<tr><td>x / y / z</td><td>描画位置 (ピクセル)</td></tr>
|
<tr><td>x / y / z</td><td>描画位置 (ピクセル)</td></tr>
|
||||||
<tr><td>zoom / sx / sy</td><td>拡大率 (1.0 で等倍)</td></tr>
|
<tr><td>zoom / sx / sy</td><td>拡大率 (1.0 で等倍)</td></tr>
|
||||||
<tr><td>rx / ry / rz</td><td>X / Y / Z 軸回転角 (度)</td></tr>
|
<tr><td>rx / ry / rz</td><td>X / Y / Z 軸回転角 (度)</td></tr>
|
||||||
@@ -585,7 +600,7 @@ setmetatable, getmetatable, rawget, rawset, rawequal, rawlen, pcall, xpcall
|
|||||||
<h3>obj 関数</h3>
|
<h3>obj 関数</h3>
|
||||||
<table border="1">
|
<table border="1">
|
||||||
<tr><th>関数</th><th>説明</th></tr>
|
<tr><th>関数</th><th>説明</th></tr>
|
||||||
<tr><td>obj.getobject(tag)</td><td>他アイテムの描画情報を取得 (本ページ 12 章)</td></tr>
|
<tr><td>obj.getobject(tag [, frame])</td><td>他アイテムの描画情報を取得 (本ページ 12 章)</td></tr>
|
||||||
<tr><td>obj.getpixel(x, y)</td><td>ピクセル取得</td></tr>
|
<tr><td>obj.getpixel(x, y)</td><td>ピクセル取得</td></tr>
|
||||||
<tr><td>obj.setpixel(x, y, r, g, b [, a])</td><td>ピクセル書き込み</td></tr>
|
<tr><td>obj.setpixel(x, y, r, g, b [, a])</td><td>ピクセル書き込み</td></tr>
|
||||||
<tr><td>obj.getpixeldata()</td><td>ピクセル直接アクセスプロキシ</td></tr>
|
<tr><td>obj.getpixeldata()</td><td>ピクセル直接アクセスプロキシ</td></tr>
|
||||||
|
|||||||
新しいイシューから参照
ユーザーをブロックする