0 Members and 1 Guest are viewing this topic.
Can you please give more details?
//----------------------------------------------------------------------------------------------------------bool Tiles::LoadAndInitializeTiles(void){int posX;int posY;int tileWidth = 32;int tileHeight = 32;sf::IntRect rect;sf::Color transparentColor;sf::Color colorToSetNoTransparency(126, 0, 0, 255); SelectedTile.Resize(32, 32); SelectedTile.SetColor( sf::Color(0, 0, 0, 128) ); TilesSheet = new sf::Image; if (!TilesSheet->LoadFromFile("data/graphics/in_game/SMBEnginE.png")) return EXIT_FAILURE; posX = 0; posY = 0; transparentColor = TilesSheet->GetPixel(posX, posY); rect.Top = posY + 1; rect.Bottom = posY + 1 + tileHeight; rect.Left = posX + 1; rect.Right = posX + 1 + tileWidth; if (!TilesArray[0].TilesImage.LoadFromFile("data/graphics/in_game/32x32.png")) return EXIT_FAILURE; TilesArray[0].TilesImage.Copy(*TilesSheet, 0, 0, rect); if (transparentColor != colorToSetNoTransparency) TilesArray[0].TilesImage.CreateMaskFromColor(transparentColor, 0); TilesArray[0].TilesSprite.SetImage(TilesArray[0].TilesImage); TilesArray[0].TilesSprite.SetBlendMode(sf::Blend::None); TilesArray[0].TilesSprite.SetCenter(TilesArray[0].TilesSprite.GetSize() / 2.f); delete TilesSheet; return EXIT_SUCCESS;}//----------------------------------------------------------------------------------------------------------
I think you misunderstand what the blend mode is Here it's working perfectly, otherwise your transparent white would be transparent. If you're talking about disabling the pixel bilinear filter, you should rather try calling SetSmooth(false) on your image.