增加预览画面播放速度参数
This commit is contained in:
@@ -37,6 +37,8 @@ namespace SpineViewer.Models
|
||||
|
||||
public uint MaxFps { get; set; } = 30;
|
||||
|
||||
public float Speed { get; set; } = 1f;
|
||||
|
||||
public bool ShowAxis { get; set; } = true;
|
||||
|
||||
public Color BackgroundColor { get; set; }
|
||||
|
||||
@@ -104,6 +104,7 @@
|
||||
<s:String x:Key="Str_Zoom">Zoom</s:String>
|
||||
<s:String x:Key="Str_Rotation">Rotation (Degrees)</s:String>
|
||||
<s:String x:Key="Str_MaxFps">Max FPS</s:String>
|
||||
<s:String x:Key="Str_PlaySpeed">Playback Speed</s:String>
|
||||
<s:String x:Key="Str_RenderSelectedOnly">Render Selected Only</s:String>
|
||||
<s:String x:Key="Str_ShowAxis">Show Axis</s:String>
|
||||
<s:String x:Key="Str_BackgroundColor">Background Color</s:String>
|
||||
|
||||
@@ -104,6 +104,7 @@
|
||||
<s:String x:Key="Str_Zoom">ズーム</s:String>
|
||||
<s:String x:Key="Str_Rotation">回転(度)</s:String>
|
||||
<s:String x:Key="Str_MaxFps">最大FPS</s:String>
|
||||
<s:String x:Key="Str_PlaySpeed">再生速度</s:String>
|
||||
<s:String x:Key="Str_RenderSelectedOnly">選択のみレンダリング</s:String>
|
||||
<s:String x:Key="Str_ShowAxis">座標軸を表示</s:String>
|
||||
<s:String x:Key="Str_BackgroundColor">背景色</s:String>
|
||||
|
||||
@@ -104,6 +104,7 @@
|
||||
<s:String x:Key="Str_Zoom">缩放</s:String>
|
||||
<s:String x:Key="Str_Rotation">旋转(角度)</s:String>
|
||||
<s:String x:Key="Str_MaxFps">最大帧率</s:String>
|
||||
<s:String x:Key="Str_PlaySpeed">播放速度</s:String>
|
||||
<s:String x:Key="Str_RenderSelectedOnly">仅渲染选中</s:String>
|
||||
<s:String x:Key="Str_ShowAxis">显示坐标轴</s:String>
|
||||
<s:String x:Key="Str_BackgroundColor">背景颜色</s:String>
|
||||
|
||||
@@ -140,6 +140,13 @@ namespace SpineViewer.ViewModels.MainWindow
|
||||
set => SetProperty(_renderer.MaxFps, value, v => _renderer.MaxFps = value);
|
||||
}
|
||||
|
||||
public float Speed
|
||||
{
|
||||
get => _speed;
|
||||
set => SetProperty(ref _speed, Math.Clamp(value, 0.01f, 100f));
|
||||
}
|
||||
private float _speed = 1f;
|
||||
|
||||
public bool ShowAxis
|
||||
{
|
||||
get => _showAxis;
|
||||
@@ -390,7 +397,7 @@ namespace SpineViewer.ViewModels.MainWindow
|
||||
if (_cancelToken?.IsCancellationRequested ?? true) break; // 提前中止
|
||||
|
||||
sp.Update(0); // 避免物理效果出现问题
|
||||
sp.Update(delta);
|
||||
sp.Update(delta * _speed);
|
||||
|
||||
// 为选中对象绘制一个半透明背景
|
||||
if (sp.IsSelected)
|
||||
@@ -441,23 +448,25 @@ namespace SpineViewer.ViewModels.MainWindow
|
||||
FlipX = FlipX,
|
||||
FlipY = FlipY,
|
||||
MaxFps = MaxFps,
|
||||
Speed = Speed,
|
||||
ShowAxis = ShowAxis,
|
||||
BackgroundColor = BackgroundColor,
|
||||
};
|
||||
}
|
||||
set
|
||||
{
|
||||
ResolutionX = value.ResolutionX;
|
||||
ResolutionY = value.ResolutionY;
|
||||
CenterX = value.CenterX;
|
||||
CenterY = value.CenterY;
|
||||
Zoom = value.Zoom;
|
||||
Rotation = value.Rotation;
|
||||
FlipX = value.FlipX;
|
||||
FlipY = value.FlipY;
|
||||
MaxFps = value.MaxFps;
|
||||
ShowAxis = value.ShowAxis;
|
||||
BackgroundColor = value.BackgroundColor;
|
||||
ResolutionX = value.ResolutionX;
|
||||
ResolutionY = value.ResolutionY;
|
||||
CenterX = value.CenterX;
|
||||
CenterY = value.CenterY;
|
||||
Zoom = value.Zoom;
|
||||
Rotation = value.Rotation;
|
||||
FlipX = value.FlipX;
|
||||
FlipY = value.FlipY;
|
||||
MaxFps = value.MaxFps;
|
||||
Speed = value.Speed;
|
||||
ShowAxis = value.ShowAxis;
|
||||
BackgroundColor = value.BackgroundColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -693,6 +693,7 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 水平分辨率 -->
|
||||
@@ -731,13 +732,17 @@
|
||||
<Label Grid.Row="8" Grid.Column="0" Content="{DynamicResource Str_MaxFps}"/>
|
||||
<TextBox Grid.Row="8" Grid.Column="1" Text="{Binding MaxFps}"/>
|
||||
|
||||
<!-- 播放速度 -->
|
||||
<Label Grid.Row="9" Grid.Column="0" Content="{DynamicResource Str_PlaySpeed}"/>
|
||||
<TextBox Grid.Row="9" Grid.Column="1" Text="{Binding Speed}"/>
|
||||
|
||||
<!-- 显示坐标轴 -->
|
||||
<Label Grid.Row="9" Grid.Column="0" Content="{DynamicResource Str_ShowAxis}"/>
|
||||
<ToggleButton Grid.Row="9" Grid.Column="1" IsChecked="{Binding ShowAxis}"/>
|
||||
<Label Grid.Row="10" Grid.Column="0" Content="{DynamicResource Str_ShowAxis}"/>
|
||||
<ToggleButton Grid.Row="10" Grid.Column="1" IsChecked="{Binding ShowAxis}"/>
|
||||
|
||||
<!-- 背景颜色 -->
|
||||
<Label Grid.Row="10" Grid.Column="0" Content="{DynamicResource Str_BackgroundColor}" ToolTip="#AARRGGBB"/>
|
||||
<TextBox Grid.Row="10" Grid.Column="1" Text="{Binding BackgroundColor}" ToolTip="#AARRGGBB"/>
|
||||
<Label Grid.Row="11" Grid.Column="0" Content="{DynamicResource Str_BackgroundColor}" ToolTip="#AARRGGBB"/>
|
||||
<TextBox Grid.Row="11" Grid.Column="1" Text="{Binding BackgroundColor}" ToolTip="#AARRGGBB"/>
|
||||
|
||||
<!-- 背景图案 -->
|
||||
<!-- 背景图案模式 -->
|
||||
|
||||
Reference in New Issue
Block a user