# SelectTransition (Slick - The 2D Library)
Date: 2013-06-03

## org.newdawn.slick.state.transition
Class SelectTransition

    java.lang.Object
      org.newdawn.slick.state.transition.SelectTransition

All Implemented Interfaces:
  Transition

    public class SelectTransition

extends java.lang.Object
implements Transition

A transition that moves to the next as though it was selected by some background menu. Note this transition is provided as an example more than intended for use. The values contained are designed for 800x600 resolution. This is an enter transition

Author:
  kevin

Field Summary
`protected static SGL` `GL` The renderer to use for all GL operations

Constructor Summary
`SelectTransition()` Create a new transition
`SelectTransition(Color background)` Create a new transition

Method Summary
`void` `init(GameState firstState, GameState secondState)` Initialise the transition
`boolean` `isComplete()` Check if this transtion has been completed
`void` `postRender(StateBasedGame game, GameContainer container, Graphics g)` Render the transition over the existing state rendering
`void` `preRender(StateBasedGame game, GameContainer container, Graphics g)` Render the transition before the existing state rendering
`void` `update(StateBasedGame game, GameContainer container, int delta)` Update the transition.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### GL

    protected static SGL GL

  The renderer to use for all GL operations

Constructor Detail

### SelectTransition

    public SelectTransition()

  Create a new transition

### SelectTransition

    public SelectTransition(Color background)

  Create a new transition

  Parameters:
    `background` - The background colour to draw under the previous state

Method Detail

### init

    public void init(GameState firstState,
                     GameState secondState)

  Description copied from interface: `Transition`
  Initialise the transition

  Specified by:
    `init` in interface `Transition`
  Parameters:
    `firstState` - The first state we're rendering (this will be rendered by the framework)
    `secondState` - The second stat we're transitioning to or from (this one won't be rendered)
  See Also:
    `Transition.init(org.newdawn.slick.state.GameState, org.newdawn.slick.state.GameState)`

### isComplete

    public boolean isComplete()

  Description copied from interface: `Transition`
  Check if this transtion has been completed

  Specified by:
    `isComplete` in interface `Transition`
  Returns:
    True if the transition has been completed
  See Also:
    `Transition.isComplete()`

### postRender

    public void postRender(StateBasedGame game,
                           GameContainer container,
                           Graphics g)
                    throws SlickException

  Description copied from interface: `Transition`
  Render the transition over the existing state rendering

  Specified by:
    `postRender` in interface `Transition`
  Parameters:
    `game` - The game this transition is being rendered as part of
    `container` - The container holding the game
    `g` - The graphics context to use when rendering the transiton
  Throws:
    `SlickException` - Indicates a failure occured during the render
  See Also:
    `Transition.postRender(org.newdawn.slick.state.StateBasedGame, org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics)`

### preRender

    public void preRender(StateBasedGame game,
                          GameContainer container,
                          Graphics g)
                   throws SlickException

  Description copied from interface: `Transition`
  Render the transition before the existing state rendering

  Specified by:
    `preRender` in interface `Transition`
  Parameters:
    `game` - The game this transition is being rendered as part of
    `container` - The container holding the game
    `g` - The graphics context to use when rendering the transiton
  Throws:
    `SlickException` - Indicates a failure occured during the render
  See Also:
    `Transition.preRender(org.newdawn.slick.state.StateBasedGame, org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics)`

### update

    public void update(StateBasedGame game,
                       GameContainer container,
                       int delta)
                throws SlickException

  Description copied from interface: `Transition`
  Update the transition. Cause what ever happens in the transition to happen

  Specified by:
    `update` in interface `Transition`
  Parameters:
    `game` - The game this transition is being rendered as part of
    `container` - The container holding the game
    `delta` - The amount of time passed since last update
  Throws:
    `SlickException` - Indicates a failure occured during the update
  See Also:
    `Transition.update(org.newdawn.slick.state.StateBasedGame, org.newdawn.slick.GameContainer, int)`

Copyright © 2006 New Dawn Software. All Rights Reserved.