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.


Topics - efeman

Pages: [1]
1
Graphics / Extending RectangleShape and Rendering
« on: July 18, 2013, 02:29:15 am »
I think this problem is from my lack of C++ experience, so forgive me if it's silly. I'm creating a Tile class for the usual reasons, and wanted to just extend RectangleShape so that I could keep all the nice things already available and just add extras for my implementation. So I have it defined as:

class Tile : public sf::RectangleShape {
public:
        Tile(sf::Vector2f pos, const sf::Color color);
        void render(sf::RenderWindow& window);
};
 

The confusion I'm having is with how to render something like this. With a RectangleShape, you can just call window.draw(rectshape). I was hoping to define it something like

void Tile::render(sf::RenderWindow& window) {
        window.draw(this);
}
 

but alas it doesn't work that way.

2
Graphics / Converting to standard Cartesian
« on: July 07, 2013, 11:24:17 pm »
I found some old posts similar to this, specifically http://en.sfml-dev.org/forums/index.php?topic=5990.0 from late 2011/early 2012.

I'd like to flip the Y-axis back to use standard Cartesian. Is there a good way to do this without doing changes to every individual entity?

Pages: [1]