Changes

40 bytes added ,  18:38, 23 September 2022
link updated per talk page
Line 258: Line 258:  
</syntaxhighlight>
 
</syntaxhighlight>
   −
To create a custom menu, you need to create a subclass of <samp>IClickableMenu</samp> and assign it to <samp>Game1.activeClickableMenu</samp>. At its most basic, a menu is basically just a few methods you override (usually <samp>draw</samp> and <samp>receiveLeftClick</samp> at a minimum). When <samp>draw</samp> is called, you draw whatever you want to the screen; when <samp>receiveLeftClick</samp> is called, you check if it's within one of the clickable areas and handle it. Normally you'd use some convenience classes like <samp>ClickableTextureButton</samp> (which has a texture and position, and simplifies checking if they were clicked), though that's not strictly necessary. Here's [https://github.com/janavarro95/Stardew_Valley_Mods/blob/master/GeneralMods/HappyBirthday/Framework/BirthdayMenu.cs a simple menu] you can use as an example, which draws the birthday menu for {{nexus mod|520|Birthday Mod}}.
+
To create a custom menu, you need to create a subclass of <samp>IClickableMenu</samp> and assign it to <samp>Game1.activeClickableMenu</samp>. At its most basic, a menu is basically just a few methods you override (usually <samp>draw</samp> and <samp>receiveLeftClick</samp> at a minimum). When <samp>draw</samp> is called, you draw whatever you want to the screen; when <samp>receiveLeftClick</samp> is called, you check if it's within one of the clickable areas and handle it. Normally you'd use some convenience classes like <samp>ClickableTextureButton</samp> (which has a texture and position, and simplifies checking if they were clicked), though that's not strictly necessary. Here's [https://github.com/janavarro95/Stardew_Valley_Mods/blob/d7d567a72f5feaf3a5a5afd3d054ac9598727a97/GeneralMods/HappyBirthday/Framework/Menus/BirthdayMenu.cs a simple menu] you can use as an example, which draws the birthday menu for {{nexus mod|520|Birthday Mod}}.
    
===DialogueBox===
 
===DialogueBox===
106,039

edits