public DialogControl(NeutralNpc npc)
        {
            _npc = npc;

            _boxColor = new Color(0, 0, 0, 100);
            _lineHeight = (int)_npc.inGameLevel.spriteService.TextSize("H").Y+12;

            //Litt massive opprettelser for å legge boksene i en salgs mal. Source har ikke noe å si?
            npcTalkBox = new StaticSprite("box", new Rectangle(40, (int)_npc.inGameLevel.spriteService.GameWindowSize.Y, _maxTextWidth + 20, 0),
                new Rectangle(0, 0, 1, 1), 1001f, _boxColor);
            npcNameBox = new StaticSprite("box", new Rectangle(70, (int)_npc.inGameLevel.spriteService.GameWindowSize.Y-(_lineHeight),
                (int)_npc.inGameLevel.spriteService.TextSize(_npc.npcName).X + 10, _lineHeight), new Rectangle(0, 0, 1, 1), 1001f, _boxColor);
            playerTalkBox = new StaticSprite("box",
                new Rectangle((int)_npc.inGameLevel.spriteService.GameWindowSize.X - 560, (int)_npc.inGameLevel.spriteService.GameWindowSize.Y, _maxTextWidth + 20, 0),
                new Rectangle(0, 0, 1, 1), 1001f, _boxColor);
            playerNameBox = new StaticSprite("box",
                new Rectangle((int)_npc.inGameLevel.spriteService.GameWindowSize.X - 105, (int)_npc.inGameLevel.spriteService.GameWindowSize.Y - (_lineHeight), 35, _lineHeight),
                new Rectangle(0, 0, 1, 1), 1001f, _boxColor);

            npcSaysPos.X = npcTalkBox.DestinationX + 10;
            npcSaysPos.Y = npcTalkBox.DestinationY + _textOffsetY;

            npcNamePos = new Vector2(npcNameBox.DestinationX + 5, npcNameBox.DestinationY + 6);
            playerNamePos = new Vector2(playerNameBox.DestinationX + 5, playerNameBox.DestinationY + 6);
        }
Beispiel #2
0
 public Healthbar(int maxHp, int characterHeight)
 {
     _scaledWidth = (int)( _width * _scale);
     _scaledHeight = (int)(_height * _scale);
     _characterHeight = (int)(characterHeight * _scale);
     healthBarSprite = new StaticSprite("healthBar", new Rectangle(0,0, _scaledWidth, _scaledHeight), new Rectangle(0,0, _width, _height));
     healthContainerSprite = new StaticSprite("healthContainer", new Rectangle(0, 0, _scaledWidth, _scaledHeight), new Rectangle(0, 0, _width, _height));
 }
 public FightingLevel(Player player1, Game game)
     : base(player1, game)
 {
     //Laster inn bakgrunnen og og healthbars
     _background = new StaticSprite("ground", new Rectangle(0, 0, 1245, 700));
     spriteService.LoadDrawable(_background);
     spriteService.LoadDrawable(new StaticSprite("healthBar"));
     spriteService.LoadDrawable(new StaticSprite("healthContainer"));
 }
 public ChooseDirectionLevel(Player player1, Game game)
     : base(player1, game)
 {
     //bakgrunnsbildet
     _background = new StaticSprite("chooseLevelGround", new Rectangle(0, 0, (int)spriteService.GameWindowSize.X, (int)spriteService.GameWindowSize.Y));
     spriteService.LoadDrawable(_background);
     //skiltet
     _sign = new StaticSprite("sign", new Rectangle(650, 200, 206, 173), 200 + 140);
     spriteService.LoadDrawable(_sign);
 }
Beispiel #5
0
        public TownLevel(Player player1, Game game)
            : base(player1, game)
        {
            _background = new StaticSprite("ground", new Rectangle(0, 0, (int)spriteService.GameWindowSize.X, (int)spriteService.GameWindowSize.Y));
            spriteService.LoadDrawable(_background);

            _shopkeeper = new MerchantNpc("shopkeeper", new Rectangle(400, 300, 118, 219), _player1, this);
            spriteService.LoadDrawable(_shopkeeper);
            _oracle = new OracleNpc("oracle", new Rectangle(900, 200, 148, 174), _player1, this);
            spriteService.LoadDrawable(_oracle);
        }
Beispiel #6
0
        public MiningLevel(Player player1, Game game)
            : base(player1, game)
        {
            //Legger til en bakgrunn
            _background = new StaticSprite("ground", new Rectangle(0, 0, (int)spriteService.GameWindowSize.X, (int)spriteService.GameWindowSize.Y));
            spriteService.LoadDrawable(_background);

            //Laster inn "stoneHit" som Texture2d
            spriteService.LoadDrawable(new StaticSprite("stonehit"));

            GoldStones = 3;
        }
        protected override void LoadContent()
        {
            _spriteBatch = new SpriteBatch(this.Game.GraphicsDevice);
            //Laster inn sprite som brukes til å "erstatte" musepekeren
            cursor = new StaticSprite("cursor",new Rectangle(0,0,25,32));
            LoadDrawable(cursor);
            //laster inn Arial og setter linjehøyde
            _arialFont = Game.Content.Load<SpriteFont>("arial");
            _arialFont.LineSpacing = 22;

            base.LoadContent();
        }