Open main menu
Home
Random
Log in
Settings
About Stardew Valley Wiki
Disclaimers
Stardew Valley Wiki
Search
Changes
← Older edit
Newer edit →
Modding:Common tasks
(view source)
Revision as of 18:44, 11 May 2021
264 bytes added
,
18:44, 11 May 2021
→Banner message
:
Example code for signature #4
Line 218:
Line 218:
Note: For those of you who want a custom HUDMessage:
Note: For those of you who want a custom HUDMessage:
- Almost all of these variables are public, excluding messageSubject, so feel free to customize!
- Almost all of these variables are public, excluding messageSubject, so feel free to customize!
−
−
For example: add a new HUDMessage to show [[File:Error-image-ingame.png]] toaster popup.
For example: add a new HUDMessage to show [[File:Error-image-ingame.png]] toaster popup.
<syntaxhighlight lang="c#">
<syntaxhighlight lang="c#">
Game1.addHUDMessage(new HUDMessage("MESSAGE", 3));
Game1.addHUDMessage(new HUDMessage("MESSAGE", 3));
+
</syntaxhighlight>
+
+
Another example: add a HUDMessage that shows up like a simple rectangle with no icon, and no square for the icon:
+
<syntaxhighlight lang="c#">
+
Game1.addHUDMessage(new HUDMessage("MESSAGE", "")); // second parameter is the 'leaveMeNull' parameter
</syntaxhighlight>
</syntaxhighlight>
Pepoluan
57
edits