Added a new slider mode.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@99 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -17,11 +17,18 @@ import com.threerings.jme.util.TimeFunction;
|
||||
*/
|
||||
public class WindowSlider extends Node
|
||||
{
|
||||
// slides from the specified location into the center of the screen
|
||||
public static final int FROM_TOP = 0;
|
||||
public static final int FROM_RIGHT = 1;
|
||||
|
||||
// slides from the center of the screen off screen in the specified direction
|
||||
public static final int TO_TOP = 2;
|
||||
public static final int TO_RIGHT = 3;
|
||||
|
||||
// slides down from the specified location stopping when whole window is visible (window
|
||||
// remains "stuck" to the edge from which it slid in)
|
||||
public static final int FROM_TOP_STICKY = 4;
|
||||
|
||||
/**
|
||||
* Creates a window slider with the specified mode and window that will
|
||||
* slide the window either onto or off of the screen in the specified
|
||||
@@ -65,6 +72,11 @@ public class WindowSlider extends Node
|
||||
end = swidth+wwidth;
|
||||
window.setLocation(start, (sheight-wheight)/2 + dy);
|
||||
break;
|
||||
|
||||
case FROM_TOP_STICKY:
|
||||
start = sheight+wheight;
|
||||
end = sheight-wheight + dy;
|
||||
window.setLocation((swidth-wwidth)/2 + dx, start);
|
||||
}
|
||||
|
||||
_mode = mode;
|
||||
|
||||
Reference in New Issue
Block a user