Class ReferenceGridExtensions
Adds a ReferenceGrid to a game.
public static class ReferenceGridExtensions
- Inheritance
-
ReferenceGridExtensions
Methods
AddGrid(IGame, GridSpace, Keys)
Adds a grid with numbered lines that shows world coordinates or screen pixels, for finding your way around a scene while building it.
public static ReferenceGrid AddGrid(this IGame game, GridSpace space = GridSpace.World, Keys toggleKey = Keys.G)
Parameters
gameIGameThe game to add the grid to.
spaceGridSpaceThe coordinates the grid starts in.
toggleKeyKeysThe key that steps through off, world and screen. Pass None for no key, and switch from code with Cycle(), Visible and Space.
Returns
- ReferenceGrid
The grid, whose properties can be changed at any time.
Examples
game.SetupBase3DScene();
var grid = game.AddGrid();
Remarks
Call after the graphics compositor and a camera exist, from the Start callback. The grid follows the first camera of the compositor.
Exceptions
- InvalidOperationException
The game has no scene yet.