コード例 #1
0
        private void DrawCompoundCharacter(string compoundCharacter, TextLayout layout)
        {
            var  oldTransform = DeviceContext.Transform;
            bool stretched    = false;

            if (NeedsStretching(compoundCharacter, layout))
            {
                var scale     = Matrix3x2.Transformation((float)1 / compoundCharacter.Length, 1.0f, 0.0f, 0.0f, 0.0f);
                var transform = Matrix3x2.Multiply(scale, DeviceContext.Transform);
                DeviceContext.Transform = transform;
                stretched = true;
            }

            DrawCharacter(compoundCharacter, stretched, layout);
            DeviceContext.Transform = oldTransform;
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: ingen084/Ingen.Game
            public override void Render()
            {
                DeviceContext.Clear(Color.CornflowerBlue);

                DeviceContext.Transform = Matrix3x2.Rotation(position * 0.018f, new Vector2(position + 50, position + 150));
                DeviceContext.DrawBitmap(Resource, "Image", new RawRectangleF(position, position + 100, position + 100, position + 200));
                DeviceContext.Transform = Matrix3x2.Transformation(1, 1, 0, 10, 10);
                DeviceContext.DrawSprite(Resource, "Sprite");
                DeviceContext.Transform = Matrix3x2.Identity;

                SpriteBatch.Begin();

                SpriteBatch.Draw(Resource.Get <SpriteResource>("Saikoro"), new Vector2(position + 100, 150), position * 0.018f);

                SpriteBatch.End();
            }