Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
Modding:Modder Guide/APIs/Content
(view source)
Revision as of 02:53, 28 November 2022
20 bytes removed
,
02:53, 28 November 2022
→Edit a map
Line 383:
Line 383:
:: Edit or replace part of the map. This is basically a copy & paste operation, so the source map is applied over the loaded map. For example:
:: Edit or replace part of the map. This is basically a copy & paste operation, so the source map is applied over the loaded map. For example:
:: <syntaxhighlight lang="C#">
:: <syntaxhighlight lang="C#">
−
public void
Edit
<T>
(
IAssetData
asset
)
+
e.
Edit(asset
=>
{
{
var editor = asset.AsMap();
var editor = asset.AsMap();
Line 389:
Line 389:
Map sourceMap = this.Helper.ModContent.Load<Map>("custom-map.tmx");
Map sourceMap = this.Helper.ModContent.Load<Map>("custom-map.tmx");
editor.PatchMap(sourceMap, targetArea: new Rectangle(30, 10, 20, 20));
editor.PatchMap(sourceMap, targetArea: new Rectangle(30, 10, 20, 20));
−
}
+
}
);
</syntaxhighlight>
</syntaxhighlight>
Atravita
528
edits
Navigation menu
Personal tools
Create account
Log in
Namespaces
Modding
Discussion
Variants
Views
Read
View source
View history
More
Search
Navigation
Main page
Recent changes
Admin noticeboard
Help Editing
Random page
Official Links
Official Site
Official Forums
Official Merchandise
Discord
Reddit
Tools
Upload file
Special pages
Printable version