Changes

Jump to navigation Jump to search
→‎Concepts: + zoom level
Line 77: Line 77:  
| Maps <tt>Long</tt>, <tt>Point</tt>, or <tt>Vector2</tt> keys to instances of <tt>TValue</tt> (the underlying value type) and <tt>TNetValue</tt> (the synchronised net type). You can iterate key/value pairs like <code>foreach (KeyValuePair<Long, TValue> pair in field.Pairs)</code> (replacing <tt>Long</tt> with <tt>Point</tt> or <tt>Vector2</tt> if needed).
 
| Maps <tt>Long</tt>, <tt>Point</tt>, or <tt>Vector2</tt> keys to instances of <tt>TValue</tt> (the underlying value type) and <tt>TNetValue</tt> (the synchronised net type). You can iterate key/value pairs like <code>foreach (KeyValuePair<Long, TValue> pair in field.Pairs)</code> (replacing <tt>Long</tt> with <tt>Point</tt> or <tt>Vector2</tt> if needed).
 
|}
 
|}
 +
 +
===Zoom level===
 +
The player can set an in-game zoom level between 75% and 200%, which adjusted the size of all pixels shown on the screen. For example, here's a player in the same position at minimum and maximum zoom levels:
 +
 +
{| class="wikitable"
 +
|-
 +
! min zoom level (75%)
 +
! max zoom level (200%)
 +
|-
 +
| [[File:Zoom level 75.png|300px]]
 +
| [[File:Zoom level 200.png|300px]]
 +
|}
 +
 +
In game code, this is represented by the <tt>Game1.options.zoomLevel</tt> field. Coordinates are generally adjusted for zoom level automatically, so you rarely need to account for this; but you can convert an unadjusted coordinate using <code>position * (1f / Game1.options.zoomLevel)</code> if needed.
    
==Main classes==
 
==Main classes==
translators
8,456

edits

Navigation menu