Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - CBenni::O

Pages: 1 2 3 [4]
46
Graphics / [SOLVED] Tiling a sprite
« on: December 25, 2009, 06:53:16 pm »
Quote from: "Laurent"
Did you check RenderImage::IsAvailable?

Yes, I did ;)
Quote
Do you call MyRenderImg->Display() (like for RenderWindow)?

Yes, but that didn't change anything either...

But I'm trying to recover my original program, and I will upload it as soon as possible.

bye, CBenni::O

47
Graphics / [SOLVED] Tiling a sprite
« on: December 25, 2009, 06:07:06 pm »
Well... I dont have the original code, but this is (approx.) what it did:
Code: [Select]
class CGameboard
{
public:
//[...]
void ChangeField(sf::Vector2i vWhere,int newType);

private:
//[...]
sf::Sprite* Tiles[10]; // Sprites of my Tiles (are Initialized somewhere else, and they are loaded correctly, have checked that
SGBField Fields[1024]; // The Fields of my Gameboard (32x32 Matrix)
sf::Sprite* MySprite; // Sprite that is rendered to
sf::RenderImage MyRenderImg; // RenderImage used for Rendering
};

void CGameboard::ChangeField(sf::Vector2i vWhich, int newType)
{
       Fields[vWhich.x+vWhitch.y*32].Type = newType; // Set the new Type of the Field
       Tiles[newType]->SetPosition(Fields[vWhich.x+vWhitch.y*32].Position); // Move the Sprite to the Position where they should be rendered
       MyRenderImg->Render(Tiles[newType]);
//Adding MyRenderImg->Flush() here didn't change anything
       MySprite->SetImage(MyRenderImg);
}


I hope you understand what I did

bye, CBenni::O

48
Graphics / [SOLVED] Tiling a sprite
« on: December 25, 2009, 04:52:14 pm »
Hy!
I had a similar Problem, I wanted to program a tile-based PacMan game, so I downloaded the SFML2.0 using the SVN, but when I tried to render using the RenderImage class, nothing was drawn, neither Flush() nor anything else I tried, helped.
When I looked at the Image in the debugger, I found out that still every single Pixel was black.

Does someone have an idea, or even better, a piece of Code which demonstates Rendering on a Sprite (in realtime!)?

bye, CBenni::O

Pages: 1 2 3 [4]
anything