public class Window extends java.lang.Object implements IUpdateable, ITouchListener
Constructor and Description |
---|
Window() |
Modifier and Type | Method and Description |
---|---|
void |
addChild(Window window)
Add a new child window to this window
|
void |
endBlend()
Jump to the end of current blending operations.
|
void |
fadeIn(float maxAlpha,
float time)
Fade the window in until maxAlpha has been reached.
|
void |
fadeOut(float minAlpha,
float time)
Fade the window out until minAlpha has been reached
|
float |
getAlpha()
Get the current alpha value
|
com.tyrlib2.gui.Window.BLEND_STATE |
getBlendState()
Get the current blending state
|
Window |
getChild(int index)
Get an indexed child window
|
int |
getCountChildren()
Get the number of child windows
|
java.lang.String |
getName()
Get the name of the window
|
long |
getPriority()
Get the priority of this window
|
Vector2 |
getRelativePos()
Get the position of this window relative to the parent
|
Vector2 |
getSize()
Get the size values of this window
|
boolean |
getVisible()
Is this window visible?
|
boolean |
isBeingTouched()
Is this window currently touched by the user?
|
boolean |
isEnabled()
Is this window enabled?
|
boolean |
isFinished()
Is this window alive?
|
boolean |
isPassingTouchEventsThrough()
Does this window let touch events through?
|
boolean |
isReceivingTouchEvents()
Is this window receiving touch events?
|
boolean |
onTouchDown(Vector2 point,
MotionEvent event) |
boolean |
onTouchMove(Vector2 point,
MotionEvent event)
React to a touch move event
|
boolean |
onTouchUp(Vector2 point,
MotionEvent event) |
void |
onUpdate(float time)
Update all timed actions of this window
|
void |
removeChild(Window window)
Remove a child window from this window
|
void |
setAlpha(float alpha)
Set an alpha value
|
void |
setPassTouchEventsThrough(boolean passTouchEventsThrough)
Set whether windows behind this window will receive touch events
|
void |
setReceiveTouchEvents(boolean receiveTouchEvents)
Set if this window is supposed to receive touch events
|
void |
setRelativePos(Vector2 pos)
Set the position of this window relative to its parent
|
void |
setSize(Vector2 size)
Resize this window
|
void |
setVisible(boolean visible)
Set the visibility of this window
|
public void fadeOut(float minAlpha, float time)
minAlpha
- The target alpha valuetime
- Time until minAlpha will be reachedpublic void fadeIn(float maxAlpha, float time)
maxAlpha
- The target alpha valuetime
- The time until maxAlpha will be reachedpublic com.tyrlib2.gui.Window.BLEND_STATE getBlendState()
public void endBlend()
public void addChild(Window window)
window
- public void removeChild(Window window)
window
- public int getCountChildren()
public Window getChild(int index)
index
- public void onUpdate(float time)
onUpdate
in interface IUpdateable
time
- public boolean isFinished()
isFinished
in interface IUpdateable
public java.lang.String getName()
public void setAlpha(float alpha)
alpha
- public float getAlpha()
public void setRelativePos(Vector2 pos)
pos
- public Vector2 getRelativePos()
public void setSize(Vector2 size)
size
- public Vector2 getSize()
public long getPriority()
getPriority
in interface Prioritizable
public boolean onTouchDown(Vector2 point, MotionEvent event)
onTouchDown
in interface ITouchListener
public boolean onTouchUp(Vector2 point, MotionEvent event)
onTouchUp
in interface ITouchListener
public boolean onTouchMove(Vector2 point, MotionEvent event)
onTouchMove
in interface ITouchListener
public boolean isBeingTouched()
public boolean isEnabled()
isEnabled
in interface ITouchListener
public boolean isReceivingTouchEvents()
public void setReceiveTouchEvents(boolean receiveTouchEvents)
receiveTouchEvents
- public boolean isPassingTouchEventsThrough()
public void setPassTouchEventsThrough(boolean passTouchEventsThrough)
passTouchEventsThrough
- public void setVisible(boolean visible)
visible
- public boolean getVisible()