示例#1
0
 public TextRenderState(TextureManager textureManager)
 {
     _textureManager = textureManager;
     _font = new Font(textureManager.Get("font"),
         FontParser.Parse("font.fnt"));
     _helloWorld = new Text("Hello", _font);
 }
示例#2
0
 public TextTestState(TextureManager textureManager)
 {
     _text.Texture = textureManager.Get("font");
     //_text.SetUVs(new Point(0.113f, 0), new Point(0.17f, 0.101f));
     //_text.SetWidth(15);
     //_text.SetHeight(26);
 }
示例#3
0
 public FramesTestState(TextureManager textureManager)
 {
     _textureManager = textureManager;
     _font = new Font(textureManager.Get("font"),
         FontParser.Parse("font.fnt"));
     _fpsText = new Text("FPS: ", _font);
 }
示例#4
0
        public Game()
        {
            _game = new GameWindow();
            _stateManager = new ScreenManager();
            _textureManager = new TextureManager();
            _fontManager = new FontManager();

            SetupViewport();
        }
示例#5
0
 public DrawSpriteState(TextureManager textureManager)
 {
     _textureManager = textureManager;
     Texture texture = _textureManager.Get("face_alpha");
     Gl.glEnable(Gl.GL_TEXTURE_2D);
     Gl.glBindTexture(Gl.GL_TEXTURE_2D, texture.Id);
     Gl.glEnable(Gl.GL_BLEND);
     Gl.glBlendFunc(Gl.GL_SRC_ALPHA, Gl.GL_ONE_MINUS_SRC_ALPHA);
 }
示例#6
0
        public TextWrapTest(TextureManager textureManager)
        {
            _textureManager = textureManager;
            _font = new Font(textureManager.Get("font"),
                FontParser.Parse("font.fnt"));

            _longText = new Text("The quick brown fox jumps over the lazy dog",
               _font, 400);
        }
示例#7
0
        public TweenTestState(TextureManager textureManager)
        {
            _sprite.Texture = textureManager.Get("face");

            for (int i = 0; i < 10; i++)
            {
                _sprite.SetRotation(i);
            }
        }
示例#8
0
        public TestSpriteClassState(TextureManager textureManager)
        {
            _textureManager = textureManager;
            _testSprite.Texture = _textureManager.Get("face_alpha");
            _testSprite.SetHeight(256 * 0.5f);

            _testSprite2.Texture = _textureManager.Get("face_alpha");
            _testSprite2.SetPosition(-256, -256);
            _testSprite2.SetColor(new Color(1, 0, 0, 1));
        }
示例#9
0
        public MatrixTestState(TextureManager textureManager)
        {
            _faceSprite.Texture = textureManager.Get("face");
            Gl.glEnable(Gl.GL_TEXTURE_2D);

            Matrix m = new Matrix();
            m.SetRotate(new Vector(0, 0, 1), Math.PI / 5);

            Matrix mScale = new Matrix();

            //change z to a 2
            mScale.SetScale(new Vector (2.0, 2.0, 2.0));

            m *= mScale;
            Vector scale = m.GetScale();
            m *= m.Inverse();

            for(int i = 0; i < _faceSprite.VertexPositions.Length; i++)
            {
                _faceSprite.VertexPositions[i] *= m;
            }
        }
 public TextRenderState(TextureManager textureManager)
 {
     _textureManager = textureManager;
     _font           = new Font(textureManager.Get("font"), FontParser.Parse("Image/font.fnt"));
 }
 public DrawSpriteState(TextureManager textureManager)
 {
     m_TextureManager = textureManager;
     m_HalfHeight     = m_Height / 2.0f;
     m_HalfWidth      = m_Width / 2.0f;
 }
示例#12
0
 public SpecialEffectState(TextureManager manager)
 {
     _font = new Font(manager.Get("font"), FontParser.Parse("font.fnt"));
     _text = new Text("Hello", _font);
 }
示例#13
0
 public DrawSpriteState(TextureManager textureManager)
 {
     _textureManager = textureManager;
 }