コード例 #1
0
ファイル: Pile.cs プロジェクト: galaxyyao/TouhouGrave
 public override void Update(float deltaTime)
 {
     if (m_pileBackTexture == null)
     {
         var quad = (Control.Style.ChildIds["CardBack"].Target as UI.ComposedImage).Quads.First().TextureQuad;
         m_pileBackTexture = new Graphics.VirtualTexture(quad.Texture.XnaTexture,
             new Microsoft.Xna.Framework.Rectangle(
                 (int)quad.UVBounds.Left + quad.Texture.Bounds.Left,
                 (int)quad.UVBounds.Top + quad.Texture.Bounds.Top,
                 (int)quad.UVBounds.Width,
                 (int)quad.UVBounds.Height));
     }
 }
コード例 #2
0
ファイル: SpellButtons.cs プロジェクト: galaxyyao/TouhouGrave
        public SpellButtons(CardControl control) : base(control)
        {
            // TODO: spell button shall be stylized from cardcontrol's style
            const int IntervalV = 10;

            m_buttonFaceTexture = GameApp.Service<Services.ResourceManager>().Acquire<Graphics.VirtualTexture>("atlas:Textures/UI/InGame/Atlas0$Button");
            var buttonFace = new Graphics.TexturedQuad(m_buttonFaceTexture);
            var font = new Graphics.TextRenderer.FontDescriptor("Segoe UI", 16);

            int y = 0;
            foreach (var spell in Card.Spells)
            {
                y -= m_buttonFaceTexture.Height + IntervalV;

                var btn = new Button
                {
                    NormalFace = buttonFace,
                    ButtonText = GameApp.Service<Graphics.TextRenderer>().FormatText(spell.Model.Name, new Graphics.TextRenderer.FormatOptions(font))
                };
                btn.Transform = MatrixHelper.Translate(-m_buttonFaceTexture.Width / 2, y);
                btn.MouseButton1Up += new EventHandler<MouseEventArgs>(SpellButton_MouseButton1Up);
                btn.Dispatcher = m_spellButtonContainer;
                m_spellButtons.Add(btn);
            }
 
            m_fadeInOutTrack.Elapsed += w =>
            {
                foreach (var button in Buttons)
                {
                    var clr = new Color(1.0f, 1.0f, 1.0f, w);
                    button.NormalFace.ColorToModulate = clr;
                    button.TextColor = clr;
                }
                if (w == 0.0f)
                {
                    m_spellButtonContainer.Dispatcher = null;
                }
            };
        }
コード例 #3
0
ファイル: Glow.cs プロジェクト: galaxyyao/TouhouGrave
 public override void Startup()
 {
     CardGlow = GameApp.Service<Services.ResourceManager>().Acquire<Graphics.VirtualTexture>("Textures/CardGlow");
 }
コード例 #4
0
 public override void Startup()
 {
     DashLine = GameApp.Service<Services.ResourceManager>().Acquire<Graphics.VirtualTexture>("Textures/UI/Common/DashLine");
     SolidLine = GameApp.Service<Services.ResourceManager>().Acquire<Graphics.VirtualTexture>("Textures/UI/Common/SolidLine");
 }