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

Pages: [1]
1
Graphics / size of view different from size of window
« on: January 06, 2011, 07:39:18 pm »
Quote
But now, if I draw an interface, I must use another rectangle for what is really visible on the screen, as the sprites in the region of the interface won't be visible.

Quote
Don't you have two separate views?


Yes I have 2 views, but there are some sprites of the world that would be drawed in the area of the screen of the interface. Of course that won't happen because the interface is drawn after the world, so the sprites are overwritten in the screen by the interface.

I must avoid calling the draw method of those sprites, because it is useless and spend time, just a bit, but it does.

2
Graphics / size of view different from size of window
« on: January 06, 2011, 06:55:11 pm »
I understand.

It will be great to have various views as "cameras" focusing on different parts of the world for example, all in different sections of the screen.

Besides having the view limited to a portion of the screen, I can know exactly what it is viewed of the world, by checking it's rectangle, and the sprites one.

In the game I am developing I must avoid drawing all the sprites of the world, because it will be too slow. So, when I detect that the rectangle of the view doesn't intersects the rectangle of the sprite, I know that I must remove the sprite from the drawing list.

But now, if I draw an interface, I must use another rectangle for what is really visible on the screen, as the sprites in the region of the interface won't be visible.

Well it is logic now, thank you very much for the advice.

3
Graphics / size of view different from size of window
« on: January 06, 2011, 05:54:42 pm »
Quote
Who said that? The documentation says that the contents of a view are always mapped to the entire window. Unless you use SFML 2.


I am missing someting here. If the view is mapped to the entire window, why I can make a view of certain dimensions, if it will fit all the screen?

My idea about views was that i could make a view for, suppose the world, and another for the user interface, for example, and put them together, and move/scrool only the world view, whereas the user interface view remains static.

Is there a way to achieve this?

4
Graphics / size of view different from size of window
« on: January 05, 2011, 08:56:36 pm »
Quote from: "DevilWithin"
The view is basicly the range of pixels you want to fit into your viewport.

If your view equals the viewport(in your case, whole window), there is no apparent scale, and the ratio will look good, but when you try to make a view different from the viewport, you will obvious get stretching or shrinking. Views are great for zoom and panning features for games.

If you don't want any resizing, you should only offset your current view, move it(panning) by a few pixels, but don't change its Width or Height. If this is not what you're looking for, probably neither are Views.

Imagine you have a screen with 1024x768 resolution.
If you make a view of 10x768, you are trying to fit a tiny 10-pixel-width column into the whole window, so you'll get major stretching, up to the point it's unrecognizable ;D

Correct me if i'm wrong : )


I disagree with that, because it is supposed that I can create a view that can occupy only a portion of the screen, the view doesn't fit all the screen, indeed I can have two or more views in the same screen.
As I said when I posted the question, the sprites got smaller than they really are, not bigger as would be if you were right.

5
Graphics / size of view different from size of window
« on: January 05, 2011, 01:28:42 pm »
Hi, I made a view that is smaller than the size of the window, and I noticed that the sprites on the view are scaled, they have a smaller size than it's original. This doesn't happen if the size of the view equals the size of the window. My question is if I can avoid the sprites scaling.

6
General / Rect interpretation
« on: December 12, 2010, 09:49:40 pm »
thanks.

7
General / Rect interpretation
« on: December 12, 2010, 09:29:39 pm »
Hi, I want to know how to interpret the top, bottom, right, left members of the Rect class.
Are left & up the left-top coordinate and bottom & right the bottom-right coordinate?
If it is like this, Is the bottom-right coordinate absolute or relative to the left-top coordinate?

Pages: [1]