Beispiel #1
0
 private void TsbTransform_TextChanged(object sender, EventArgs e)
 {
     if (TsbTransform.Text == "TXT")
     {
         //Console.WriteLine("Rtb已经显示");
         Ste.Hide();
         Rtb.Show();
         TsbTransform.ToolTipText = "显示超文本视图";
     }
     //if (TsbTransform.ToolTipText == "显示超文本视图")
     else
     {
         Rtb.Hide();
         Ste.Show();
         TsbTransform.ToolTipText = "显示文本视图";
     }
 }
Beispiel #2
0
 protected override void Update(GameTime gameTime)
 {
     Ste.UpdateInput();
     timer += 0.15f;
     if (timer2 > 0)
     {
         timer2--;
     }
     if (Keyboard.GetState().IsKeyDown(Keys.A))
     {
         if (timer2 == 0)
         {
             timer2 += 15;
         }
     }
     if (Ste.MouseState.Left == ButtonState.Pressed)
     {
         bullets.Add(new MeteorBullet(new Vector2(960, 540), (Ste.MouseState.Position - new Vector2(960, 540)).Angle(), 0));
     }
     if (Keyboard.GetState().IsKeyDown(Keys.B))
     {
         timer = 0;
     }
     if (Keyboard.GetState().IsKeyDown(Keys.Space) && !lastSpace)
     {
         refresh = !refresh;
     }
     lastSpace = Keyboard.GetState().IsKeyDown(Keys.Space);
     EntityManager.Update(bullets);
     for (int i = 14; i > 0; i--)
     {
         mousePos[i] = mousePos[i - 1];
     }
     mousePos[0] = Ste.MouseState.Position;
     //mousePos[0] = Mouse.GetState().Position.ToVector2() + ellipse.Get(timer);
     //mousePos[0] = new Vector2((float)Math.Cos(timer * 2.5f), (float)Math.Sin(timer * 2.5f)) * 200 + new Vector2(960, 540);
     //mousePos[0] = new Vector2(timer * 200, timer * timer * 10);
     base.Update(gameTime);
 }
Beispiel #3
0
        protected override void Initialize()
        {
            Ste.Initialize(this, graphics);
            Window.AllowUserResizing = true;
            bullets = new List <Bullet>();
            Ste.ChangeResolution(1920, 1080);
            a = new FlareFxAlt(graphicsDevice, 40, 40, "Test2");
            MeteorBullet.flarefx    = new FlareFx(graphicsDevice, 40, 40, "Test");
            MeteorBullet.flarefxAlt = a as FlareFxAlt;
            mousePos    = new Vector2[15];
            vertexBatch = new VertexBatch(graphicsDevice);
            //var n = new FontStb_Native(Ste.GetAsset("SourceHanSansCN-Regular.ttf"), graphicsDevice);
            //text = new DynamicTextureTextGDI(graphicsDevice, Environment.CurrentDirectory + Path.DirectorySeparatorChar + "SourceHanSansCN-Regular.ttf", 40, "***ABCD文字绘制测试\nStellaris\n增益免疫汉化组");
            dtt = new DynamicSpriteFont(graphicsDevice, Ste.GetAsset("SourceHanSansCN-Regular.ttf"), 80, useNative: false);
            var font = new FontStb_Native(Ste.GetAsset("Product-Sans-Regular.ttf"));

            font.ReverseFont = dtt.font;
            dtt2             = new DynamicSpriteFont(graphicsDevice, font, 80);
            tex3             = Texture2D.FromStream(graphicsDevice, Ste.GetAsset("trail3.png"));
            tex  = Texture2D.FromStream(graphicsDevice, Ste.GetAsset("zzzz.png"));
            tex2 = Texture2D.FromStream(graphicsDevice, Ste.GetAsset("trail3.png"));
            z    = new Effect(graphicsDevice, Ste.GetAsset("Blur.cfx").ToByteArray());
            base.Initialize();
        }