Changes

Jump to navigation Jump to search
→‎Edit a map: + ExtendMap
Line 363: Line 363:  
</gallery>
 
</gallery>
 
|}
 
|}
 +
 +
{{SMAPI upcoming|3.14.0|content=&#32;
 +
; ExtendMap
 +
: Extend the map if needed to fit the given size. Note that '''this is an expensive operation''' and resizes the map in-place. For example:
 +
: <syntaxhighlight lang="C#">
 +
public void Edit<T>(IAssetData asset)
 +
{
 +
  var editor = asset.AsMap();
 +
 +
  // make sure the map is at least 256 tiles high
 +
  editor.ExtendImage(minWidth: editor.Data.Width, minHeight: 256);
 +
}
 +
</syntaxhighlight>
 +
: Available method arguments:
 +
: {{{!}} class="wikitable"
 +
{{!}}-
 +
! argument
 +
! usage
 +
{{!}}-
 +
{{!}} <samp>minWidth</samp>
 +
{{!}} The minimum desired width in tiles. If the map width is less than this value, it'll be extended on the right up to that size.
 +
{{!}}-
 +
{{!}} <samp>minHeight</samp>
 +
{{!}} The minimum desired height in tiles. If the map height is less than this value, it'll be extended from the bottom up to that size.
 +
{{!}}}
 +
}}
    
==Advanced==
 
==Advanced==
translators
8,404

edits

Navigation menu