示例#1
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            texture = Content.Load<Texture2D>("texture");
            textureAtlas = Content.Load<TextureAtlas>("atlasJSON");
            textureRegion = textureAtlas.GetRegion("Enemy Bug");
        }
示例#2
0
        public WelcomeScreen(GameScreenManager gameScreenManager, Texture2D interfaceTexture,
                             TextureAtlas interfaceAtlas)
            : base(gameScreenManager)
        {
            _interfaceTexture = interfaceTexture;
            _interfaceAtlas = interfaceAtlas;
            _buttonExitPosition.Width =
                _buttonLoadGamePosition.Width =
                _buttonNewGamePosition.Width =
                _buttonSettingsPosition.Width = _interfaceAtlas.GetRegion("NewGame").Bounds.Width;

            _buttonExitPosition.Height =
                _buttonLoadGamePosition.Height =
                _buttonNewGamePosition.Height =
                _buttonSettingsPosition.Height = _interfaceAtlas.GetRegion("NewGame").Bounds.Height;
            _inputs = new MainInput();
            _spriteBatch = new SpriteBatch(MainGame.GraphicD);
        }
示例#3
0
        public Sprite(Beatup game, string atlas_name, string sheet_name, string sprite_name)
        {
            atlas = game.Content.Load<TextureAtlas>(atlas_name);
            region = atlas.GetRegion(sprite_name);

            sheet = game.Content.Load<Texture2D>(sheet_name);

            this.position.X = 0;
            this.position.Y = 0;

            flippedX = false;
            rotation = 0;

            scale_x = 4.0f;
            scale_y = 4.0f;
        }
示例#4
0
        public CharacterAnim(TextureAtlas atlas, string prefix, string action, int defaultFrame,
                             Vector2[] myFramesOffsets, byte speed = SpeedNormal)
        {
            _myAtlas = atlas;
            //_spriteBatch = PlayScreen.Spritebatch;
            // var mainAtlas = PlayScreen.DecorationAtlas;
            AnimationPrefix = prefix;
            AnimationAction = action;
            AnimationLength = myFramesOffsets.Length;
            AnimationSpeed = speed;
            _defaultFrame = defaultFrame;
            _currentFrame = _defaultFrame;
            _myFramesOffsets = myFramesOffsets;

            _myFrames = new TextureRegion[AnimationLength];

            for (var i = 0; i < AnimationLength; i++)
                _myFrames[i] = atlas.GetRegion(string.Format("{0}-{1}{2}", prefix, action, i));
        }