Changes

Jump to navigation Jump to search
m
Replace deprecated <source> tags with <syntaxhighlight> tags
Line 134: Line 134:     
: If you need to draw UI when the game isn't in UI mode, you can explicitly set UI scaling mode:
 
: If you need to draw UI when the game isn't in UI mode, you can explicitly set UI scaling mode:
: <source lang="c#">Game1.game1.InUIMode(() =>
+
: <syntaxhighlight lang="c#">Game1.game1.InUIMode(() =>
 
{
 
{
 
   // your UI draw code here
 
   // your UI draw code here
 
});
 
});
</source>
+
</syntaxhighlight>
    
: In UI mode, you should usually replace <tt>Game1.viewport</tt> with <tt>Game1.uiViewport</tt>. '''Don't''' do this if you'll adjust the positions for UI scaling separately, since double-conversion will give you incorrect results. You can convert between UI and non-UI coordinates using <tt>Utility.ModifyCoordinatesForUIScale</tt> and <tt>Utility.ModifyCoordinatesFromUIScale</tt>.
 
: In UI mode, you should usually replace <tt>Game1.viewport</tt> with <tt>Game1.uiViewport</tt>. '''Don't''' do this if you'll adjust the positions for UI scaling separately, since double-conversion will give you incorrect results. You can convert between UI and non-UI coordinates using <tt>Utility.ModifyCoordinatesForUIScale</tt> and <tt>Utility.ModifyCoordinatesFromUIScale</tt>.
114

edits

Navigation menu