Dem1se

1,301 bytes added ,  06:51, 12 November 2021
Add next two sections of Additional Info
Line 144: Line 144:  
int XPos = (Game1.viewport.Width / 2) - (UIWidth / 2);
 
int XPos = (Game1.viewport.Width / 2) - (UIWidth / 2);
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
=== Decompiling the Game ===
 +
 +
Use dotPeek (''free'') or ILSpy to [[Modding:Modder_Guide/Get_Started#How_do_I_decompile_the_game_code.3F | decompile the game ]] and view what are the available UI/Graphics classes in the game, to either modify or use within your UI. You'll have to look inside of <code>StardewValley.Menus</code> namespace mostly.
 +
 +
=== Available UI Components ===
 +
 +
The best way to find the complete list of all the UI / graphics components you can use in your UI is to decompile Stardew Valley yourself and looking at what's available. I'll still list a few fundamental types that every UI will use, and might even find to be enough usually:
 +
 +
{| class="wikitable"
 +
! '''Component Name'''
 +
! '''Uses'''
 +
! '''Namespace'''
 +
|-
 +
| ClickableTextureComponent
 +
| Can be used to display any texture asset, including any image. Commonly used for buttons, images, etc.
 +
| StardewValley.Menus
 +
|-
 +
| ClickableComponent
 +
| Commonly used to draw text labels. Base of ClickableTextureComponent.
 +
| StardewValley.Menus
 +
|-
 +
| TextBox
 +
| Typical textbox. Used to get text inputs from users
 +
| StardewValley.Menus
 +
|-
 +
| SpriteText
 +
| While not a drawable component by itself, contains useful methods to draw TextScrolls to screen like <code>#drawStringWithScrollCenteredAt()</code>
 +
| StardewValley.BellsAndWhistles
 +
|}
21

edits