Changes

Jump to navigation Jump to search
→‎Edit an image: + ExtendImage in SMAPI 3.3
Line 292: Line 292:  
* <tt>PatchMode.Overlay</tt>: draw the new content over the original content, so the original content shows through any ''fully'' transparent pixels.
 
* <tt>PatchMode.Overlay</tt>: draw the new content over the original content, so the original content shows through any ''fully'' transparent pixels.
 
|}
 
|}
 +
 +
{{SMAPI upcoming|3.3|content=&#32;
 +
; ExtendImage
 +
: Extend the image if needed to fit the given size. Note that '''this is an expensive operation''', creates a new texture instance, and extending a spritesheet horizontally may cause game errors or bugs. For example:
 +
: <source lang="C#">
 +
public void Edit<T>(IAssetData asset)
 +
{
 +
  var editor = asset.AsImage();
 +
 +
  // make sure the image is at least 1000px high
 +
  editor.ExtendImage(minWidth: editor.Data.Width, minHeight: 1000);
 +
}
 +
</source>
 +
: Available method arguments:
 +
: {{{!}} class="wikitable"
 +
{{!}}-
 +
! argument
 +
! usage
 +
{{!}}-
 +
{{!}} <tt>minWidth</tt>
 +
{{!}} The minimum desired width. If the image width is less than this value, it'll be extended on the right up to that size.
 +
{{!}}-
 +
{{!}} <tt>minHeight</tt>
 +
{{!}} The minimum desired height. If the image height is less than this value, it'll be extended from the bottom up to that size.
 +
{{!}}}
 +
}}
    
==Advanced==
 
==Advanced==
translators
8,403

edits

Navigation menu