Open main menu
Home
Random
Log in
Settings
About Stardew Valley Wiki
Disclaimers
Stardew Valley Wiki
Search
Changes
← Older edit
Newer edit →
Modding:Modder Guide/APIs
(view source)
Revision as of 17:51, 18 July 2017
200 bytes added
,
17:51, 18 July 2017
→Read assets
:
+ map example
Line 406:
Line 406:
</source></li>
</source></li>
−
<li>Read a
custom
tilesheet for a map from your mod folder:
+
<li>Read a
map from your mod folder (will automatically fix tilesheet references):
+
<source lang="c#">
+
Map map = helper.Content.Load<Map>(@"assets\map.tbin", ContentSource.ModFolder);
+
</source></li>
+
+
<li>Read a new
tilesheet for a map from your mod folder:
<source lang="c#">
<source lang="c#">
tilesheet.ImageSource = helper.Content.GetActualAssetKey(@"assets\tilesheet.png", ContentSource.ModFolder);
tilesheet.ImageSource = helper.Content.GetActualAssetKey(@"assets\tilesheet.png", ContentSource.ModFolder);
</source></li>
</source></li>
−
<li>Read an asset from game's content folder:
+
<li>Read an asset from
the
game's content folder:
<source lang="c#">
<source lang="c#">
var data = helper.Content.Load<Dictionary<int, string>>(@"Data\ObjectInformation.xnb", ContentSource.GameContent);
var data = helper.Content.Load<Dictionary<int, string>>(@"Data\ObjectInformation.xnb", ContentSource.GameContent);
Pathoschild
translators
8,404
edits