xsge.transition

This module provides a framework for transition animations.

xsge.transition Classes

xsge.transition.Room

class xsge.transition.Room(objects=(), width=None, height=None, views=None, background=None, background_x=0, background_y=0, room_number=None)[source]

This class is a variant of sge.Room with transition support. Transitions are done using xsge.transition.Room.show_transition(). In general, it is best to use xsge.transition.Room.transition_start(), xsge.transition.Room.transition_resume(), and xsge.transition.Room.transition_end(), which show transitions in between the current and next room.

xsge.transition.Room Methods

Room.show_transition(transition, sprite, duration)[source]

Show a transition.

Arguments:

  • transition – The type of transition to use. Should be one of the following:
    • xsge.transition.FADE – Fade out (to black) and then fade in.
    • xsge.transition.DISSOLVE – Gradually replace the first room with the second room.
    • xsge.transition.PIXELATE – Pixelate the first room, then fade into the second room. If sge.game.scale_smooth is True, the effect will instead be to blur and unblur the rooms. This relies on the destructiveness of changing sge.Sprite.width and sge.Sprite.height.
    • xsge.transition.WIPE_LEFT – Wipe transition from left to right.
    • xsge.transition.WIPE_RIGHT – Wipe transition from right to left.
    • xsge.transition.WIPE_TOP – Wipe transition from top to bottom.
    • xsge.transition.WIPE_BOTTOM – Wipe transition from bottom to top.
    • xsge.transition.WIPE_TOPLEFT – Diagonal wipe transition from top-left to bottom-right.
    • xsge.transition.WIPE_TOPRIGHT – Diagonal wipe transition from top-right to bottom-left.
    • xsge.transition.WIPE_BOTTOMLEFT – Diagonal wipe transition from bottom-left to top-right.
    • xsge.transition.WIPE_BOTTOMRIGHT – Diagonal wipe transition from bottom-right to top-left.
    • xsge.transition.WIPE_MATRIX – Matrix wipe transition.
    • xsge.transition.IRIS_IN – Iris in transition.
    • xsge.transition.IRIS_OUT – Iris out transition.
  • sprite – The sprite to use as the first image (the one being transitioned out of). Generally should be a screenshot of the previous room.
  • duration – The time the transition should take in milliseconds.
Room.transition_start(transition=1, duration=1500)[source]

Start the room, using a transition.

See the documentation for sge.Room.start() and xsge.transition.Room.show_transition() for more information.

Room.transition_resume(transition=1, duration=1500)[source]

Resume the room, using a transition.

See the documentation for sge.Room.resume() and xsge.transition.Room.show_transition() for more information.

Room.transition_end(transition=1, duration=1500, next_room=None, resume=True)[source]

End the room, using a transition for the next room.

See the documentation for sge.Room.end() and xsge.transition.Room.show_transition() for more information.

Table Of Contents

Previous topic

xsge.gui

This Page