Ejemplo n.º 1
0
        public Gui(Game game) : base(game)
        {
            _neo = new Neo.Neo(game, Game1.CurrentPlatform);

            btnClickMe          = new Button(_neo);
            btnClickMe.Text     = "Click me";
            btnClickMe.Size     = new Size(110, 38);
            btnClickMe.Margins  = new Margins(50);
            btnClickMe.Anchors  = Anchors.Left;
            btnClickMe.Clicked += BtnClickMe_Clicked;

            row         = new Row(_neo);
            row.Anchors = Anchors.Left | Anchors.Right | Anchors.Top;
            row.Size    = new Size(50);
            row.Margins = new Margins(20);

            _neo.AddChildren(
                new Control[]
            {
                btnClickMe,
                row
            });

            _neo.Create();
        }
Ejemplo n.º 2
0
        /// <param name="graphicsDevice">The <see cref="GraphicsDevice"/>, which will be used for sprite rendering.</param>
        /// <param name="capacity">The initial capacity of the internal array holding batch items (the value will be rounded to the next multiple of 64).</param>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="graphicsDevice"/> is null.</exception>
        public NeoBatch(GraphicsDevice graphicsDevice, ContentManager content, Neo neo)
        {
            _neo = neo;
            if (graphicsDevice == null)
            {
                throw new ArgumentNullException("graphicsDevice");
            }

            _graphicsDevice = graphicsDevice;

            _effect = content.Load <Effect>("neo_shader");

            _batcher = new NeoBatcher(graphicsDevice, _effect, 0);

            CheckScreenResolution();

            _graphicsDevice.BlendState        = BlendState.AlphaBlend;
            _graphicsDevice.DepthStencilState = DepthStencilState.None;
            _graphicsDevice.RasterizerState   = RasterizerState.CullNone;
            _graphicsDevice.SamplerStates[0]  = SamplerState.LinearClamp;
        }
Ejemplo n.º 3
0
 public InstancedRectangles(Game game, Neo neo) : base(game)
 {
     _neo             = neo;
     _effectInstanced = Game.Content.Load <Effect>("InstancingRectangleShader");
     Initialize();
 }