Class for rooms.
This class stores the settings and objects found in a room. Rooms are used to create separate parts of the game, such as levels and menu screens.
Every game must have at least one room.
The width of the room in pixels. If set to None, sge.game.width is used.
The height of the room in pixels. If set to None, sge.game.height is used.
The sge.Background object used.
The horizontal position of the background in the room.
The vertical position of the background in the room.
A list containing all sge.StellarClass objects in the room. (Read-only)
A dictionary of lists containing all sge.StellarClass objects in the room, separated by class. The dictionary keys are classes that have been registered with sge.Game.register_class(), and the lists contain only those objects which are instances of the class indicated by the respective key. (Read-only)
The index of this room in the game, where 0 is the first room, or None if this room has not been added to a game. (Read-only)
Constructor method.
Arguments:
All other arguments set the respective initial attributes of the room. See the documentation for sge.Room for more information.
Add a StellarClass object to the room.
Arguments:
Start the room.
If the room has been changed, reset it to its original state.
Continue the room from where it left off.
If the room is unchanged (e.g. has not been started yet), this method behaves in the same way that sge.Room.start() does.
End the current room.
Arguments:
If the room chosen as the next room does not exist, the game is ended.
This triggers this room’s sge.Room.event_room_end() and resets the state of this room.
Project a single-pixel dot onto the room.
Arguments:
See the documentation for sge.Sprite.draw_dot() for more information.
Project a line segment onto the room.
Arguments:
See the documentation for sge.Sprite.draw_line() for more information.
Project a rectangle onto the room.
Arguments:
See the documentation for sge.Sprite.draw_rectangle() for more information.
Project an ellipse onto the room.
Arguments:
See the documentation for sge.Sprite.draw_ellipse() for more information.
Project a circle onto the room.
Arguments:
See the documentation for sge.Sprite.draw_circle() for more information.
Project a sprite onto the room.
Arguments:
See the documentation for sge.Sprite.draw_sprite() for more information.
Project text onto the room.
Arguments:
See the documentation for sge.Sprite.draw_text() for more information.
Room start event.
Called when the room starts. It is always called after any game start events and before any object create events occurring at the same time.
Room resume event.
Called when the room resumes without being reset to its original state (i.e. via sge.Room.resume()).
By default, this calls sge.Room.event_room_start().
Room end event.
Called when the room ends. It is always called before any game end events occurring at the same time.
Room step event.
See the documentation for sge.Game.event_step() for more information.
Key press event.
See the documentation for sge.Game.event_key_press() for more information.
Key release event.
See the documentation for sge.Game.event_key_release() for more information.
Mouse move event.
See the documentation for sge.Game.event_mouse_move() for more information.
Mouse button press event.
See the documentation for sge.Game.event_mouse_button_press() for more information.
Mouse button release event.
See the documentation for sge.Game.event_mouse_button_release() for more information.
Joystick axis move event.
See the documentation for sge.Game.event_joystick_axis_move() for more information.
Joystick HAT move event.
See the documentation for sge.Game.event_joystick_hat_move() for more information.
Joystick trackball move event.
See the documentation for sge.Game.event_joystick_trackball_move() for more information.
Joystick button press event.
See the documentation for sge.Game.event_joystick_button_press() for more information.
Joystick button release event.
See the documentation for sge.Game.event_joystick_button_release() for more information.
Gain keyboard focus event.
See the documentation for sge.Game.event_gain_keyboard_focus() for more information.
Lose keyboard focus event.
See the documentation for sge.Game.event_lose_keyboard_focus() for more information.
Gain mouse focus event.
See the documentation for sge.Game.event_gain_mouse_focus() for more information.
Lose mouse focus event.
See the documentation for sge.Game.event_lose_mouse_focus() for more information.
Close event.
See the documentation for sge.Game.event_close() for more information. This is always called before any game close events occurring at the same time.
Key press event when paused.
See the documentation for sge.Game.event_key_press() for more information.
Key release event when paused.
See the documentation for sge.Game.event_key_release() for more information.
Mouse move event when paused.
See the documentation for sge.Game.event_mouse_move() for more information.
Mouse button press event when paused.
See the documentation for sge.Game.event_mouse_button_press() for more information.
Mouse button release event when paused.
See the documentation for sge.Game.event_mouse_button_release() for more information.
Joystick axis move event when paused.
See the documentation for sge.Game.event_joystick_axis_move() for more information.
Joystick HAT move event when paused.
See the documentation for sge.Game.event_joystick_hat_move() for more information.
Joystick trackball move event when paused.
See the documentation for sge.Game.event_joystick_trackball_move() for more information.
Joystick button press event when paused.
See the documentation for sge.Game.event_joystick_button_press() for more information.
Joystick button release event when paused.
See the documentation for sge.Game.event_joystick_button_release() for more information.
Gain keyboard focus event when paused.
See the documentation for sge.Game.event_gain_keyboard_focus() for more information.
Lose keyboard focus event when paused.
See the documentation for sge.Game.event_lose_keyboard_focus() for more information.
Gain mouse focus event when paused.
See the documentation for sge.Game.event_gain_mouse_focus() for more information.
Lose mouse focus event when paused.
See the documentation for sge.Game.event_lose_mouse_focus() for more information.
Close event when paused.
See the documentation for sge.Game.event_close() for more information.