Changes
Jump to navigation
Jump to search
← 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
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