private static void RenderHighlightedCells(IDataRogueControl control, ISpriteSheet topSprite, ISpriteSheet bottomSprite, IMap currentMap, int cameraX, int cameraY, int renderWidth, int renderHeight, int offsetX, int offsetY, List <MapCoordinate> highlightedCells)
        {
            var checks = new bool[renderWidth + 2, renderHeight + 2];

            for (int y = 0; y < renderHeight; y++)
            {
                for (int x = 0; x < renderWidth; x++)
                {
                    var lookupX = cameraX - offsetX + x;
                    var lookupY = cameraY - offsetY + y;

                    var currentCell = new MapCoordinate(currentMap.MapKey, lookupX, lookupY);

                    checks[x + 1, y + 1] = highlightedCells.Contains(currentCell);
                }
            }

            BLT.Color(Color.FromArgb(128, 255, 255, 255));

            if (bottomSprite != null)
            {
                RenderLayer(BLTLayers.MapShade, control, bottomSprite, renderWidth, renderHeight, checks);
            }

            if (topSprite != null)
            {
                RenderLayer(BLTLayers.MapShade + 1, control, topSprite, renderWidth, renderHeight, checks);
            }
        }
Esempio n. 2
0
 public HairRenderer(ICharacterRenderProperties renderProperties,
                     ISpriteSheet hairSheet)
     : base(renderProperties)
 {
     _hairSheet = hairSheet;
     _hairRenderLocationCalculator = new HairRenderLocationCalculator(_renderProperties);
 }
Esempio n. 3
0
 public void AddSpriteSheetListener(ISpriteSheet listener)
 {
     if (!listeners.Contains(listener))
     {
         listeners.Add(listener);
     }
 }
Esempio n. 4
0
        public async Task <IAnimation> LoadAnimationFromSpriteSheetAsync(ISpriteSheet spriteSheet,
                                                                         IAnimationConfiguration animationConfig = null, ILoadImageConfig loadConfig = null)
        {
            animationConfig = animationConfig ?? new AGSAnimationConfiguration();
            string    filePath = spriteSheet.Path;
            IResource resource = await Task.Run(() => _resources.LoadResource(filePath));

            if (resource == null)
            {
                throw new InvalidOperationException("Failed to load sprite sheet from " + filePath);
            }
            IBitmap bitmap = await Task.Run(() => _bitmapLoader.Load(resource.Stream));

            int cellsGrabbed = 0;

            getSpriteSheetData(bitmap, spriteSheet, animationConfig, out int cellsInRow, out int cellsInCol,
                               out int _, out int cellX, out int cellY, out int cellsToGrab, out Point mainStep, out Point secondStep,
                               out AGSAnimation animation);
            for (int currentCell = 0; cellsGrabbed < cellsToGrab; currentCell++)
            {
                if (currentCell >= spriteSheet.StartFromCell)
                {
                    getImageInfo(bitmap, cellX, cellY, spriteSheet, loadConfig, filePath, out Rectangle _, out IBitmap clone, out string path, out ITexture tex);
                    IImage image = _loadImage(tex, clone, path, loadConfig, spriteSheet);
                    _addAnimationFrame(image, animation);
                    cellsGrabbed++;
                }

                nextCell(mainStep, secondStep, cellsInRow, cellsInCol, ref cellX, ref cellY);
            }
            animation.Setup();
            return(animation);
        }
Esempio n. 5
0
		public async Task<IAnimation> LoadAnimationFromSpriteSheetAsync(ISpriteSheet spriteSheet,
			IAnimationConfiguration animationConfig = null, ILoadImageConfig loadConfig = null)
		{
			animationConfig = animationConfig ?? new AGSAnimationConfiguration ();
			string filePath = spriteSheet.Path;
			IResource resource = await Task.Run(() =>_resources.LoadResource (filePath));
			if (resource == null) {
				throw new InvalidOperationException ("Failed to load sprite sheet from " + filePath);
			}
			IBitmap bitmap = await Task.Run(() => _bitmapLoader.Load (resource.Stream));
			int cellsInRow, cellsInCol, cellsTotal, cellX, cellY, cellsToGrab, cellsGrabbed = 0;
			Point mainStep, secondStep;
			AGSAnimation animation;
			getSpriteSheetData (bitmap, spriteSheet, animationConfig, out cellsInRow, out cellsInCol,
								out cellsTotal, out cellX, out cellY, out cellsToGrab, out mainStep, out secondStep,
								out animation);
			for (int currentCell = 0; cellsGrabbed < cellsToGrab; currentCell++) 
			{
				if (currentCell >= spriteSheet.StartFromCell) 
				{
                    Rectangle rect; IBitmap clone; string path; ITexture tex;
                    getImageInfo (bitmap, cellX, cellY, spriteSheet, loadConfig, filePath, out rect, out clone, out path, out tex);
                    IImage image = _loadImage (tex, clone, path, loadConfig, spriteSheet);
					_addAnimationFrame (image, animation);
					cellsGrabbed++;
				}

				nextCell (mainStep, secondStep, cellsInRow, cellsInCol, ref cellX, ref cellY);
			}
			animation.Setup ();
			return animation;
		}
Esempio n. 6
0
 public ShieldRenderer(ICharacterRenderProperties renderProperties,
                       ISpriteSheet shieldSheet,
                       bool isShieldOnBack)
     : base(renderProperties)
 {
     _shieldSheet    = shieldSheet;
     _isShieldOnBack = isShieldOnBack;
 }
Esempio n. 7
0
        public SkinRenderer(ICharacterRenderProperties renderProperties,
                            ISpriteSheet skinSheet)
            : base(renderProperties)
        {
            _skinSheet = skinSheet;

            _skinRenderLocationCalculator = new SkinRenderLocationCalculator(_renderProperties);
        }
Esempio n. 8
0
        public SpriteAnimator(ISpriteSheet spriteSheet)
        {
            _spriteSheet = spriteSheet;

            Animations = new Dictionary <object, SpriteAnimation>();
            _keysQueue = new Queue <object>();
            _period    = new Period();
        }
Esempio n. 9
0
 public WeaponRenderer(ICharacterRenderProperties renderProperties,
                       ISpriteSheet weaponSheet,
                       bool isRangedWeapon)
     : base(renderProperties)
 {
     _weaponSheet    = weaponSheet;
     _isRangedWeapon = isRangedWeapon;
 }
Esempio n. 10
0
 public EmoteRenderer(ICharacterRenderProperties renderProperties,
                      ISpriteSheet emoteSheet,
                      IPubFile <EIFRecord> itemFile)
 {
     _renderProperties             = renderProperties;
     _emoteSheet                   = emoteSheet;
     _skinRenderLocationCalculator = new SkinRenderLocationCalculator(_renderProperties, itemFile);
 }
Esempio n. 11
0
        public MappingRenderer(ISpriteSheet spriteSheet, SceneNode sceneNode)
            : base(spriteSheet)
        {
            SpriteSheet    = spriteSheet;
            SceneNode      = sceneNode;
            Transformation = Transformation.Identity;

            SubscribeDepthChanged(sceneNode);
        }
Esempio n. 12
0
        public void Add(ISpriteSheet spriteSheet)
        {
            if (_spriteDictionary.ContainsKey(spriteSheet.Name))
            {
                throw new ApplicationException($"Spritesheet loading tried to add two sprites called {spriteSheet.Name}, check spritesheet configuration.");
            }

            _spriteDictionary.Add(spriteSheet.Name, spriteSheet);
        }
Esempio n. 13
0
        public GLImage(IBitmap bitmap, string id, ITexture texture, ISpriteSheet spriteSheet, ILoadImageConfig loadConfig)
		{
			OriginalBitmap = bitmap;
			Width = bitmap.Width;
			Height = bitmap.Height;
			ID = id;
			Texture = texture;
			SpriteSheet = spriteSheet;
			LoadConfig = loadConfig;
		}
Esempio n. 14
0
 public GLImage(IBitmap bitmap, string id, ITexture texture, ISpriteSheet spriteSheet, ILoadImageConfig loadConfig)
 {
     OriginalBitmap = bitmap;
     Width          = bitmap.Width;
     Height         = bitmap.Height;
     ID             = id;
     Texture        = texture;
     SpriteSheet    = spriteSheet;
     LoadConfig     = loadConfig;
 }
Esempio n. 15
0
 public SpriteBatch(ISpriteSheet spriteSheet)
     : this(
         spriteSheet,
         ShaderProgramFactory.Get("sprite"),
         new VertexArrayObject(EngineCore.GlAdapter),
         new VertexBuffer<VertexPositionColourTexture>(EngineCore.GlAdapter),
         EngineCore.GlAdapter
     )
 {
 }
Esempio n. 16
0
 private void getImageInfo(IBitmap bitmap, int cellX, int cellY, ISpriteSheet spriteSheet,
                           ILoadImageConfig loadConfig, string filePath,
                           out Rectangle rect, out IBitmap clone, out string path, out ITexture texture)
 {
     texture = new GLTexture(loadConfig.TextureConfig, _graphics);
     rect    = new Rectangle(cellX * spriteSheet.CellWidth,
                             cellY * spriteSheet.CellHeight, spriteSheet.CellWidth, spriteSheet.CellHeight);
     clone = bitmap.Crop(rect);
     path  = string.Format("{0}_{1}_{2}", rect.X, rect.Y, filePath);
 }
Esempio n. 17
0
 private void getImageInfo(IBitmap bitmap, int cellX, int cellY, ISpriteSheet spriteSheet,
                           ILoadImageConfig loadConfig, string filePath,
                           out Rectangle rect, out IBitmap clone, out string path, out ITexture texture)
 {
     texture = new GLTexture(loadConfig.TextureConfig, _graphics, _messagePump);
     rect    = new Rectangle(cellX * spriteSheet.CellWidth,
                             cellY * spriteSheet.CellHeight, spriteSheet.CellWidth, spriteSheet.CellHeight);
     clone = bitmap.Crop(rect);
     path  = $"{rect.X}_{rect.Y}_{filePath}";
 }
Esempio n. 18
0
        public Sprite(int index, ISpriteSheet spriteSheet)
        {
            Index       = index;
            SpriteSheet = spriteSheet;

            Texture         = SpriteSheet.Texture;
            SourceRectangle = SpriteSheet.SourceRectangle(Index);
            Name            = SpriteSheet.GetName(index);
            Width           = SourceRectangle.Width;
            Height          = SourceRectangle.Height;
        }
Esempio n. 19
0
        public HatRenderer(IShaderProvider shaderProvider,
                           ICharacterRenderProperties renderProperties,
                           ISpriteSheet hatSheet,
                           ISpriteSheet hairSheet)
            : base(renderProperties)
        {
            _shaderProvider = shaderProvider;
            _hatSheet       = hatSheet;
            _hairSheet      = hairSheet;

            _hairRenderLocationCalculator = new HairRenderLocationCalculator(_renderProperties);
        }
Esempio n. 20
0
        public GameRecipe(ICoreApi coreApi, string recipeName, bool cooking) : base(cooking)
        {
            this._recipeName = recipeName;
            this._cooking    = cooking;
            if (!cooking || !CraftingRecipe.cookingRecipes.TryGetValue(recipeName, out string data))
            {
                if (!CraftingRecipe.craftingRecipes.TryGetValue(recipeName, out data))
                {
                    recipeName = "Torch";
                    data       = CraftingRecipe.craftingRecipes[recipeName];
                }
            }

            // Create ingredients
            List <IRecipePart> ingredients = new List <IRecipePart>();

            string[] splitData      = data.Split('/');
            string[] ingredientData = splitData[0].Split(' ');
            for (int i = 0; i < ingredientData.Length; i += 2)
            {
                ingredients.Add(new SObjectRecipePart(coreApi, Convert.ToInt32(ingredientData[i]), Convert.ToInt32(ingredientData[i + 1])));
            }
            this.Ingredients = ingredients;

            // Create results
            List <IRecipePart> results = new List <IRecipePart>();
            bool bigCraftable          = !cooking && Convert.ToBoolean(splitData[3]);

            string[] resultData = splitData[2].Split(' ');
            for (int i = 0; i < resultData.Length; i += 2)
            {
                if (bigCraftable)
                {
                    results.Add(new BigCraftableRecipePart(coreApi, Convert.ToInt32(resultData[i]), i + 1 < resultData.Length ? Convert.ToInt32(resultData[i + 1]) : 1));
                }
                else
                {
                    results.Add(new SObjectRecipePart(coreApi, Convert.ToInt32(resultData[i]), i + 1 < resultData.Length ? Convert.ToInt32(resultData[i + 1]) : 1));
                }
            }
            this.Results = results;

            // Get sprite
            if (results.Any())
            {
                ISpriteSheet spriteSheet = bigCraftable ? coreApi.Drawing.CraftableSpriteSheet : coreApi.Drawing.ObjectSpriteSheet;
                this.Sprite = spriteSheet.TryGetSprite(Convert.ToInt32(resultData[0]), out ISprite sprite) ? sprite : throw new InvalidOperationException($"Failed to create a sprite for {(cooking ? "cooking" : "crafting")} recipe \"{recipeName}\"");
            }
            else
            {
                throw new InvalidOperationException($"Unable to create a sprite for {(cooking ? "cooking" : "crafting")} recipe \"{recipeName}\" because it has no results");
            }
        }
Esempio n. 21
0
        public void Refresh(ICharacterRenderProperties characterRenderProperties)
        {
            Boots  = _characterSpriteCalculator.GetBootsTexture(characterRenderProperties).SheetTexture;
            Armor  = _characterSpriteCalculator.GetArmorTexture(characterRenderProperties).SheetTexture;
            Hat    = _characterSpriteCalculator.GetHatTexture(characterRenderProperties).SheetTexture;
            Shield = _characterSpriteCalculator.GetShieldTexture(characterRenderProperties).SheetTexture;
            Weapon = _characterSpriteCalculator.GetWeaponTexture(characterRenderProperties).SheetTexture;

            Hair  = _characterSpriteCalculator.GetHairTexture(characterRenderProperties).SheetTexture;
            Skin  = _characterSpriteCalculator.GetSkinTexture(characterRenderProperties);
            Emote = _characterSpriteCalculator.GetEmoteTexture(characterRenderProperties);
            Face  = _characterSpriteCalculator.GetFaceTexture(characterRenderProperties);
        }
Esempio n. 22
0
        public ISprite GetSprite(int resourceGroup, string category, string name)
        {
            SpriteLoadData vars = textures[category][name];

            if (vars.Spritesheet == "")
            {
                return(SpriteSheet.GetSingleSprite(resourceManager, vars.TextureName, resourceGroup));
            }
            else
            {
                ISpriteSheet spriteSheet = resourceManager.Load <SpriteSheet>(vars.Spritesheet, resourceGroup);
                ISprite      sprite      = new Sprite(spriteSheet.GetIndex(vars.TextureName), spriteSheet);
                return(sprite);
            }
        }
Esempio n. 23
0
        public void Refresh(ICharacterRenderProperties characterRenderProperties)
        {
            Boots  = _characterSpriteCalculator.GetBootsTexture(characterRenderProperties);
            Armor  = _characterSpriteCalculator.GetArmorTexture(characterRenderProperties);
            Hat    = _characterSpriteCalculator.GetHatTexture(characterRenderProperties);
            Shield = _characterSpriteCalculator.GetShieldTexture(characterRenderProperties);

            var weaponTextures = _characterSpriteCalculator.GetWeaponTextures(characterRenderProperties);

            Weapon      = weaponTextures[0];
            WeaponExtra = weaponTextures[1];

            Hair  = _characterSpriteCalculator.GetHairTexture(characterRenderProperties);
            Skin  = _characterSpriteCalculator.GetSkinTexture(characterRenderProperties);
            Emote = _characterSpriteCalculator.GetEmoteTexture(characterRenderProperties);
            Face  = _characterSpriteCalculator.GetFaceTexture(characterRenderProperties);
        }
Esempio n. 24
0
        private void getSpriteSheetData(IBitmap bitmap, ISpriteSheet spriteSheet, IAnimationConfiguration animationConfig,
                                        out int cellsInRow, out int cellsInCol, out int cellsTotal, out int cellX,
                                        out int cellY, out int cellsToGrab, out Point mainStep, out Point secondStep,
                                        out AGSAnimation animation)
        {
            cellsInRow = bitmap.Width / spriteSheet.CellWidth;
            cellsInCol = bitmap.Height / spriteSheet.CellHeight;
            cellsTotal = cellsInRow * cellsInCol;

            int startRow, startCol;

            getOrder(spriteSheet.Order, cellsInRow, cellsInCol, out startRow, out startCol, out mainStep, out secondStep);

            cellX       = startCol;
            cellY       = startRow;
            cellsToGrab = spriteSheet.CellsToGrab < 0 ? cellsTotal : Math.Min(spriteSheet.CellsToGrab, cellsTotal);
            animation   = new AGSAnimation(animationConfig, new AGSAnimationState(), cellsToGrab);
        }
Esempio n. 25
0
        internal SpriteBatch(
            ISpriteSheet spriteSheet,
            IShaderProgram shaderProgram,
            IVertexArrayObject vao,
            IVertexBuffer<VertexPositionColourTexture> vbo,
            IDrawAdapter adapter)
        {
            spriteSheet.ThrowIfNull(nameof(spriteSheet));
            this.spriteSheet = spriteSheet;
            Debug.Assert(shaderProgram != null, $"{nameof(shaderProgram)} was null in SpriteBatch");
            Debug.Assert(vao != null, $"{nameof(vao)} was null in SpriteBatch");
            Debug.Assert(vbo != null, $"{nameof(vbo)} was null ins SpriteBatch");
            Debug.Assert(adapter != null, $"{nameof(adapter)} was null in SpriteBatch");
            this.shaderProgram = shaderProgram;
            this.vao = vao;
            this.vbo = vbo;
            this.adapter = adapter;

            Initialise();
        }
Esempio n. 26
0
        public CharacterInfoPanel(int characterIndex,
                                  ICharacter character,
                                  INativeGraphicsManager gfxManager,
                                  IEODialogButtonService dialogButtonService,
                                  ILoginController loginController,
                                  ICharacterManagementController characterManagementController,
                                  ICharacterRendererFactory rendererFactory,
                                  IRendererRepositoryResetter rendererRepositoryResetter)
            : this(characterIndex, gfxManager, dialogButtonService)
        {
            _character       = character;
            _loginController = loginController;
            _characterManagementController = characterManagementController;
            _rendererRepositoryResetter    = rendererRepositoryResetter;

            _characterControl = new CharacterControl(character.RenderProperties, rendererFactory)
            {
                DrawPosition = new Vector2(68, 28)
            };
            _characterControl.SetParentControl(this);

            _nameLabel = new XNALabel(Constants.FontSize08pt5)
            {
                DrawArea  = GetNameLabelLocation(),
                ForeColor = ColorConstants.BeigeText,
                Text      = CapitalizeName(character.Name),
                TextAlign = LabelAlignment.MiddleCenter,
                AutoSize  = false
            };
            _nameLabel.SetParentControl(this);

            _levelLabel = new XNALabel(Constants.FontSize08pt75)
            {
                DrawArea  = GetLevelLabelLocation(),
                ForeColor = ColorConstants.BeigeText,
                Text      = character.Stats.Stats[CharacterStat.Level].ToString()
            };
            _levelLabel.SetParentControl(this);

            _adminGraphic = CreateAdminGraphic(character.AdminLevel);
        }
        private static void RenderLayer(int layer, IDataRogueControl control, ISpriteSheet sprite, int renderWidth, int renderHeight, bool[,] checks)
        {
            BLTLayers.Set(layer, control.ActivityIndex);

            for (int y = 0; y < renderHeight; y++)
            {
                for (int x = 0; x < renderWidth; x++)
                {
                    if (checks[x + 1, y + 1])
                    {
                        var renderX = control.Position.Left + x * BLTTilesIOSystem.TILE_SPACING;
                        var renderY = control.Position.Top + y * BLTTilesIOSystem.TILE_SPACING;

                        var aboveConnect = checks[x + 1, y + 1] == checks[x + 1, y];
                        var belowConnect = checks[x + 1, y + 1] == checks[x + 1, y + 2];
                        var leftConnect  = checks[x + 1, y + 1] == checks[x, y + 1];
                        var rightConnect = checks[x + 1, y + 1] == checks[x + 2, y + 1];

                        var directions = TileDirections.None;
                        if (aboveConnect)
                        {
                            directions |= TileDirections.Up;
                        }
                        if (belowConnect)
                        {
                            directions |= TileDirections.Down;
                        }
                        if (leftConnect)
                        {
                            directions |= TileDirections.Left;
                        }
                        if (rightConnect)
                        {
                            directions |= TileDirections.Right;
                        }

                        BLT.Put(renderX, renderY, sprite.Tile(directions));
                    }
                }
            }
        }
Esempio n. 28
0
 public void RemoveSpriteSheetListener(ISpriteSheet listener)
 {
     listeners.Remove(listener);
 }
Esempio n. 29
0
		public async Task<IAnimation> LoadAnimationFromSpriteSheetAsync (ISpriteSheet spriteSheet, 
			IAnimationConfiguration animationConfig = null, ILoadImageConfig loadConfig = null)
		{
			return await _spriteSheetLoader.LoadAnimationFromSpriteSheetAsync (spriteSheet, animationConfig, loadConfig);
		}
Esempio n. 30
0
		public IAnimation LoadAnimationFromSpriteSheet (ISpriteSheet spriteSheet, 
			IAnimationConfiguration animationConfig = null, ILoadImageConfig loadConfig = null)
		{
			return _spriteSheetLoader.LoadAnimationFromSpriteSheet (spriteSheet, animationConfig, loadConfig);
		}
Esempio n. 31
0
 protected SpriteBase(int index, ISpriteSheet parentSheet)
 {
     this.Index       = index;
     this.ParentSheet = parentSheet;
 }
Esempio n. 32
0
		private void getImageInfo(IBitmap bitmap, int cellX, int cellY, ISpriteSheet spriteSheet, 
                                  ILoadImageConfig loadConfig, string filePath, 
                                  out Rectangle rect, out IBitmap clone, out string path, out ITexture texture)
		{
            texture = new GLTexture(loadConfig.TextureConfig, _graphics);
			rect = new Rectangle (cellX * spriteSheet.CellWidth,
										cellY * spriteSheet.CellHeight, spriteSheet.CellWidth, spriteSheet.CellHeight);
			clone = bitmap.Crop (rect);
			path = string.Format ("{0}_{1}_{2}", rect.X, rect.Y, filePath);
		}
Esempio n. 33
0
		private void getSpriteSheetData (IBitmap bitmap, ISpriteSheet spriteSheet, IAnimationConfiguration animationConfig,
		                                out int cellsInRow, out int cellsInCol, out int cellsTotal, out int cellX,
		                                 out int cellY, out int cellsToGrab, out Point mainStep, out Point secondStep, 
		                                 out AGSAnimation animation)
		{
			cellsInRow = bitmap.Width / spriteSheet.CellWidth;
			cellsInCol = bitmap.Height / spriteSheet.CellHeight;
			cellsTotal = cellsInRow * cellsInCol;

			int startRow, startCol;
			getOrder (spriteSheet.Order, cellsInRow, cellsInCol, out startRow, out startCol, out mainStep, out secondStep);

			cellX = startCol;
			cellY = startRow;
			cellsToGrab = spriteSheet.CellsToGrab < 0 ? cellsTotal : Math.Min (spriteSheet.CellsToGrab, cellsTotal);
			animation = new AGSAnimation (animationConfig, new AGSAnimationState (), cellsToGrab);
		}
Esempio n. 34
0
 public void RemoveSpriteSheetListener(ISpriteSheet listener)
 {
     listeners.Remove(listener);
 }
Esempio n. 35
0
 public DefaultAnimatedSpriteFactory(ISpriteSheet spriteSheet)
 {
     this.spriteSheet = spriteSheet;
 }
Esempio n. 36
0
 public void AddSpriteSheetListener(ISpriteSheet listener)
 {
     if (!listeners.Contains(listener)){
         listeners.Add(listener);
     }
 }
Esempio n. 37
0
        private IImage loadImage(ITexture texture, IBitmap bitmap, string id, ILoadImageConfig config, ISpriteSheet spriteSheet)
        {
            manipulateImage(bitmap, config);
            bitmap.LoadTexture(null);
            GLImage image = new GLImage(bitmap, id, texture, spriteSheet, config);

            string imageId = image.ID;

            _textures?.GetOrAdd(imageId, () => image.Texture);
            image.OnImageDisposed.Subscribe(() => _textures.Remove(imageId));
            return(image);
        }
Esempio n. 38
0
 public async Task <IAnimation> LoadAnimationFromSpriteSheetAsync(ISpriteSheet spriteSheet,
                                                                  IAnimationConfiguration animationConfig = null, ILoadImageConfig loadConfig = null)
 {
     return(await _spriteSheetLoader.LoadAnimationFromSpriteSheetAsync(spriteSheet, animationConfig, loadConfig));
 }
Esempio n. 39
0
 public IAnimation LoadAnimationFromSpriteSheet(ISpriteSheet spriteSheet,
                                                IAnimationConfiguration animationConfig = null, ILoadImageConfig loadConfig = null)
 {
     return(_spriteSheetLoader.LoadAnimationFromSpriteSheet(spriteSheet, animationConfig, loadConfig));
 }
Esempio n. 40
0
 public Sprite(int index, ISpriteSheet parentSheet, SRectangle sourceRectangle) : base(index, parentSheet)
 {
     this.SourceRectangle = sourceRectangle;
 }
Esempio n. 41
0
        private IImage loadImage(ITexture texture, IBitmap bitmap, string id, ILoadImageConfig config, ISpriteSheet spriteSheet)
		{
			manipulateImage(bitmap, config);
			bitmap.LoadTexture(null);
			GLImage image = new GLImage (bitmap, id, texture, spriteSheet, config);

			if (_textures != null)
                _textures.GetOrAdd (image.ID, () => image.Texture);
			return image;
		}