Package horizons :: Module view :: Class View
[hide private]
[frames] | no frames]

Class View

source code

util.changelistener.ChangeListener --+
                                     |
                                    View

Class that takes care of all the camera and rendering stuff.

Instance Methods [hide private]
 
__init__(self) source code
 
end(self) source code
 
center(self, x, y)
Sets the camera position
source code
 
autoscroll(self, x, y)
Scrolling via mouse (reaching edge of screen)
source code
 
autoscroll_keys(self, x, y)
Scrolling via keyboard keys
source code
 
do_autoscroll(self) source code
 
scroll(self, x, y)
Moves the camera across the screen
source code
 
_prepare_zoom_to_cursor(self, zoom)
Change the camera's position to accommodation zooming to the specified setting.
source code
 
zoom_out(self, track_cursor=False) source code
 
zoom_in(self, track_cursor=False) source code
 
zoom(self, value) source code
 
rotate_right(self) source code
 
rotate_left(self) source code
 
set_rotation(self, rotation) source code
 
get_displayed_area(self)
Returns the coords of what is displayed on the screen as Rect
source code
 
save(self, db) source code
 
load(self, db, world) source code
 
resize_layers(self, db)
Resize layers to the size required by the entire map.
source code
    Inherited from util.changelistener.ChangeListener
 
_changed(self)
Calls every listener when an object changed
source code
 
add_change_listener(self, listener, call_listener_now=False, no_duplicates=False) source code
 
add_remove_listener(self, listener, no_duplicates=False)
A listener that listens for removal of the object
source code
 
clear_change_listeners(self)
Removes all change listeners
source code
 
discard_change_listener(self, listener)
Remove listener if it's there
source code
 
discard_remove_listener(self, listener) source code
 
has_change_listener(self, listener) source code
 
has_remove_listener(self, listener) source code
 
remove(self) source code
 
remove_change_listener(self, listener) source code
 
remove_remove_listener(self, listener) source code
Class Variables [hide private]
    Inherited from util.changelistener.ChangeListener
  log = <logging.Logger object>
Method Details [hide private]

__init__(self)
(Constructor)

source code 
Overrides: util.changelistener.ChangeListener.__init__

end(self)

source code 
Overrides: util.changelistener.ChangeListener.end

center(self, x, y)

source code 

Sets the camera position

Parameters:
  • center - tuple with x and y coordinate (float or int) of tile to center

scroll(self, x, y)

source code 

Moves the camera across the screen

Parameters:
  • x - int representing the amount of pixels to scroll in x direction
  • y - int representing the amount of pixels to scroll in y direction

zoom(self, value)

source code 
Decorators:
  • @zoom.setter

load(self, db, world)

source code 
Overrides: util.changelistener.ChangeListener.load