mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-07-18 03:24:15 -04:00
Add support for sprites with alpha mask
- Sprites with alpha mask can now be viewed and exported with transparency - Added hotkeys to control display of an alpha mask on the preview tab - Added an option to the export settings to enable/disable export with alpha mask as well - Prevented texture2D preview options from being changed with hotkeys outside of texture preview (e.g. when some other asset is selected)
This commit is contained in:
@ -231,9 +231,10 @@ namespace AssetStudioGUI
|
||||
public static bool ExportSprite(AssetItem item, string exportPath)
|
||||
{
|
||||
var type = Properties.Settings.Default.convertType;
|
||||
var alphaMask = Properties.Settings.Default.exportSpriteWithMask ? SpriteMaskMode.On : SpriteMaskMode.Off;
|
||||
if (!TryExportFile(exportPath, item, "." + type.ToString().ToLower(), out var exportFullPath))
|
||||
return false;
|
||||
var image = ((Sprite)item.Asset).GetImage();
|
||||
var image = ((Sprite)item.Asset).GetImage(alphaMask);
|
||||
if (image != null)
|
||||
{
|
||||
using (image)
|
||||
|
Reference in New Issue
Block a user