Beispiel #1
0
        public Game1()
            : base()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            // Frame rate changed to 60fps
            TargetElapsedTime = TimeSpan.FromTicks(166667);

            // Extend battery life under lock.
            InactiveSleepTime = TimeSpan.FromSeconds(1);

            //graphics.PreferredBackBufferWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
            //graphics.PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
            //graphics.IsFullScreen = true;
            //graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;
            //graphics.PreparingDeviceSettings += (o, e) => e.GraphicsDeviceInformation.PresentationParameters.PresentationInterval = PresentInterval.One;

            editorState = new EditorState();
            CellMap map = new CellMap(this, editorState)
            {
                Position = new Vector2(64f, 64f)
            };
            ButtonCollection buttons = new ButtonCollection(this, editorState)
            {
                Position = new Vector2(64f, 320f)
            };

            Components.Add(map);
            Components.Add(buttons);
        }
Beispiel #2
0
 public CellMapClick(CellMap map, Action <int, int> fn)
     : base(map.Game)
 {
     _map          = map;
     _mapCell      = map.MapCell;
     _callbackFunc = fn;
 }
Beispiel #3
0
 public CellMapHover(CellMap map) : base(map.Game)
 {
     _map        = map;
     _mapCell    = map.MapCell;
     _activeCell = new ActiveCell(map.Game);
 }