/// <summary>
        /// Creates a new hud
        /// </summary>
        /// <param name="layer"></param>
        public SpritesetHud(SceneLayer layer, PointsController controller, InputControllerState source, Int32 width, Int32 height)
            : base(layer)
        {
            _source = source;
            _controller = controller;

            _cursorStandard = new Sprite(layer, "Graphics/Pointer-Standard");
            _cursorDelete = new Sprite(layer, "Graphics/Pointer-Delete");
           
            _placingBlock = new DataBlock(source.GridPosition, source.Type == BlockType.None ? BlockType.Normal : source.Type, null);
            _placingSprite = new SpriteBlock(layer, _placingBlock);

            _spriteLogo = new Sprite(layer, "Graphics/Logo") { Position = Vector2.UnitY * 40 + Vector2.UnitX * 50 };

            if (width > 1000)
            {
                _spriteHappyPoints = new Sprite(layer, "Graphics/Icon-HappyPoints") { Position = Vector2.UnitY * 40 + Vector2.UnitX * 520 * (width / 1280f) };
                _spriteTime = new Sprite(layer, "Graphics/Icon-Time") { Position = Vector2.UnitY * 40 + Vector2.UnitX * 1130 * (width / 1280f) };
            }
            else
            {
                _spriteTime = new Sprite(layer, "Graphics/Icon-Time") { Position = Vector2.UnitY * 40 + Vector2.UnitX * (width - (1280 - 1130)) };
                _spriteHappyPoints = new Sprite(layer, "Graphics/Icon-HappyPoints") { Position = Vector2.UnitY * 90 + Vector2.UnitX * 50 };
            }
        }
Beispiel #2
0
        /// <summary>
        /// Creates a new hud
        /// </summary>
        /// <param name="layer"></param>
        public SpritesetHud(SceneLayer layer, PointsController controller, InputControllerState source)
            : base(layer)
        {
            _source     = source;
            _controller = controller;

            _cursorStandard = new Sprite(layer, "Graphics/Pointer-Standard");
            _cursorDelete   = new Sprite(layer, "Graphics/Pointer-Delete");

            _placingBlock  = new DataBlock(source.GridPosition, source.Type == BlockType.None ? BlockType.Normal : source.Type, null);
            _placingSprite = new SpriteBlock(layer, _placingBlock);

            _spriteLogo = new Sprite(layer, "Graphics/Logo")
            {
                Position = Vector2.UnitY * 40 + Vector2.UnitX * 50
            };
            _spriteHappyPoints = new Sprite(layer, "Graphics/Icon-HappyPoints")
            {
                Position = Vector2.UnitY * 40 + Vector2.UnitX * 520
            };
            _spriteTime = new Sprite(layer, "Graphics/Icon-Time")
            {
                Position = Vector2.UnitY * 40 + Vector2.UnitX * 1130
            };
        }
Beispiel #3
0
        /// <summary>
        /// Sets asset names for current displaytype
        /// </summary>
        public void SetAssetNames()
        {
            this.DisplayingType = _source.BlockType;

            _intermediateTextureName = "Graphics/Block-Place-" + SpriteBlock.AssetName(this.DisplayingType);
            this.TextureName         = "Graphics/Block-" + SpriteBlock.AssetName(this.DisplayingType);
            _texture = null;
        }
Beispiel #4
0
        /// <summary>
        /// Adds a block
        /// </summary>
        /// <param name="block"></param>
        /// <param name="position"></param>
        public void Add(SpriteBlock block)
        {
             #if SILVERLIGHT
            _grid[KeyFromPosition(block.GridPosition)] = block;
#else
            _grid.Add(KeyFromPosition(block.GridPosition), block);
#endif
        }
 /// <summary>
 /// Adds a block
 /// </summary>
 /// <param name="block"></param>
 /// <param name="position"></param>
 public void Add(SpriteBlock block)
 {
     _grid.Add(KeyFromPosition(block.GridPosition), block);
 }
Beispiel #6
0
 /// <summary>
 /// Adds a block
 /// </summary>
 /// <param name="block"></param>
 /// <param name="position"></param>
 public void Add(SpriteBlock block)
 {
     _grid.Add(KeyFromPosition(block.GridPosition), block);
 }