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 - Marcus

Pages: [1]
1
Graphics / Re: SFML and Box2D.. Shaping polygons?
« on: September 28, 2012, 04:52:16 pm »
You would have to write an algorithm to find the vertices of the image. I'm sure it has been done before. From there it's pretty easy to translate that into a Box2D polygon.

2
Graphics / Re: Text doesn't rotate around origin [bug?]
« on: September 28, 2012, 04:17:14 pm »
For any other sprite, the origin is considered the top left corner. The same rule seems to apply to  text. You have to manually set the origin to be the center of the text.

3
Graphics / Re: Making a "Paint" Application
« on: September 28, 2012, 04:04:48 pm »
As Nexus stated, don't create a massive list of circles. It's inefficient and can be done much better.

The easy way to do it is to have a single circle object that can be resized and recolored as needed. Then when the user clicks, you set the center of the circle to the position of the mouse and then draw the circle for as long as the user clicks. When the user stops clicking, you can move it to a position off-screen and then stop calling the draw command on it.

Don't call clear(), this will keep the drawn image on the screen instead of having to draw a bunch of circles. You can implement an interface that the user can use to change colors/brushes but make sure it gets drawn over the drawing space. Alternatively you can place it in a separate window.

4
General / Why was sf::Shape split up?
« on: April 08, 2012, 07:18:22 am »
I was wondering why sf::Shape was split up from SFML 1.6 to SFML 2. I tried to convert my nice static base class to SFML2 only to find out sf::Shape were split up into sf::RectangleShape, sf::CircleShape, etc. making it impossible/unclean to have my baseclass control the derived.

I'm also wondering why the simple Line shape was phased out in favor of vertex arrays.

At least have a way of converting between the types to simplify drawing. Now I have to move all my base functions into the derived classes, destroying the point of having clean derived classes.

5
General / nope
« on: April 03, 2012, 05:04:34 am »
nope

6
Graphics / Re: Resolving 2 sprites
« on: April 02, 2012, 04:26:37 am »
What do you mean by "solid"?

7
Graphics / Unsmooth movement/sprite remnants
« on: April 01, 2012, 11:31:16 am »
Hello:

For some reason in SFML, fast moving objects look like they've been rendered multiple times. I know that I'm not rendering them multiple times, and when I take a screenshot I only see 1 image of the object. But to my eyes, it looks like a moving time-lapse photo. Then I look at old games like Contra and see fast moving objects that don't exhibit this.

What am I doing wrong?

Pages: [1]