Scrollable kind of VirtualSurface. More...
#include <VirtualScrollableSurface.hh>

Public Member Functions | |
| VirtualScrollableSurface (const std::string &name, Input &input, const Point &real_size, const Point &virtual_size) | |
| VirtualScrollableSurface (const std::string &name, Input &input, SDL_Surface *surf, const Point &virtual_size) | |
| void | setAutomaticAdjust (bool enable) |
| Automatically center visible surface from its position/size. | |
| void | moveScreenRect (const Point &to) |
| Move the absolute surface to a point on the logical surface. | |
| virtual Rect | getRenderRect () const |
| Get the absolute surface from the point (0, 0) on the screen. | |
| virtual Rect | getScreenRect () const |
| Get the absolute surface from the point (0, 0) on the logical surface. | |
| virtual void | setPos (const Point &to) |
| virtual void | update () |
| Method called each frame, to perfom user custom code. | |
| virtual void | blit (Surface &to) |
| virtual void | blit (Surface &to, const Rect &to_rect, const Rect &from_rect) |
Scrollable kind of VirtualSurface.
| Rect VirtualScrollableSurface::getRenderRect | ( | ) | const [virtual] |
Get the absolute surface from the point (0, 0) on the screen.
This is where (on the screen) the visible surface is rendered and visible by the user. This should only be used for events, ie. to compare mouse position (which has absolute position) with this surface position.
Reimplemented from Surface.
References Surface::getPos().
Referenced by sdlvisu::Map::mouseInsideMap().
| Rect VirtualScrollableSurface::getScreenRect | ( | ) | const [virtual] |
Get the absolute surface from the point (0, 0) on the logical surface.
This is where (on the logical surface) the visible surface is taken from. This looks to be also used for events... ie. to compare mouse position (which has absolute position) with this surface position. (I guess that I still need an explanation... ^^)
Reimplemented from Surface.
References Surface::getPos(), Surface::getScreenRect(), TPoint< T >::x, and TPoint< T >::y.
Referenced by sdlvisu::Map::centerViewTo(), sdlvisu::Map::mouseToSquare(), and sdlvisu::Map::update().
| void VirtualScrollableSurface::moveScreenRect | ( | const Point & | to | ) |
Move the absolute surface to a point on the logical surface.
This is where (on the logical surface) the visible surface is taken from.
Referenced by sdlvisu::Map::centerViewTo().
| void VirtualScrollableSurface::setAutomaticAdjust | ( | bool | enable | ) |
Automatically center visible surface from its position/size.
| enable | Switch on/off. |
| void VirtualScrollableSurface::update | ( | ) | [virtual] |
Method called each frame, to perfom user custom code.
You should override it.
Since a parent is assigned to the surface (and this parent is itself attached by other means to the root screen), this method is called at each frame. It is not called if this surface or one of its parent is disabled. In this method you can do what you want with your object, like processing input, updating other programs attributes, changing surface property, ...
Reimplemented from VirtualSurface.
Reimplemented in sdlvisu::Map.
References VirtualSurface::children_list_lock_, Surface::getPos(), Surface::getSize(), VirtualSurface::invalidate(), Surface::isEnabled(), Input::mouse_, VirtualSurface::unlockChildrenList(), TPoint< T >::x, and TPoint< T >::y.
1.6.3