1
Graphics / What is the best way to manage a tilemap?
« on: January 20, 2012, 09:12:29 am »Quote from: "tobybear"
Quote from: "marco_palestro"
also I can't apply a view only to part of a window: I'd like to keep a portion of the window for the map (which could use the view to move and resize), and use the rest for messages and so on. Actually, I can't move/resize only the viewport. Does anybody knows if it possible to bind a view to only part of a window?
Yes, this is possible using the SetViewport() function:
/// The viewport is the rectangle into which the contents of the
/// view are displayed, expressed as a factor (between 0 and 1)
/// of the size of the RenderTarget to which the view is applied.
/// For example, a view which takes the left side of the target would
/// be defined with View.SetViewport(sf::FloatRect(0, 0, 0.5, 1)).
/// By default, a view has a viewport which covers the entire target.
This makes another question: should I use version 2.0? I assumed to use 1.6 because it's the current version, so I though 2.0 is sort of beta, but this viewport thing seem not to be in version 1.6.