|
PulpCore | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pulpcore.sprite.Sprite pulpcore.sprite.Group pulpcore.sprite.Viewport
public class Viewport
A Viewport
is a Group
whose contents can scroll, and the contents outside the
bounds of the Group
are not visible.
Field Summary | |
---|---|
Bool |
scrollPixelSnapping
The flag to indicate pixel snapping for scroll location. |
Fixed |
scrollX
The scroll x location, relative to the origin of this Viewport. |
Fixed |
scrollY
The scroll y location, relative to the origin of this Viewport. |
Fields inherited from class pulpcore.sprite.Sprite |
---|
alpha, anchorX, anchorY, angle, CENTER, DEFAULT, EAST, enabled, height, NORTH, NORTH_EAST, NORTH_WEST, pixelSnapping, SOUTH, SOUTH_EAST, SOUTH_WEST, visible, WEST, width, x, y |
Constructor Summary | |
---|---|
Viewport(int x,
int y,
int w,
int h)
|
Method Summary | |
---|---|
void |
add(int index,
Sprite sprite)
Calls getContentPane().add(index, sprite); . |
void |
add(Sprite sprite)
Calls getContentPane().add(sprite); . |
int |
getContentHeight()
|
Group |
getContentPane()
|
int |
getContentWidth()
|
protected int |
getNaturalHeight()
Gets the fixed-point value of the Sprite's natural height. |
protected int |
getNaturalWidth()
Gets the fixed-point value of the Sprite's natural width. |
boolean |
isOverflowClipped()
Returns true . |
void |
moveDown(Sprite sprite)
Calls getContentPane().moveDown(sprite); . |
void |
moveToBottom(Sprite sprite)
Calls getContentPane().moveToBottom(sprite); . |
void |
moveToTop(Sprite sprite)
Calls getContentPane().moveToTop(sprite); . |
void |
moveUp(Sprite sprite)
Calls getContentPane().moveUp(sprite); . |
void |
remove(Sprite sprite)
Calls getContentPane().remove(sprite); . |
void |
removeAll()
Calls getContentPane().removeAll(); . |
void |
update(int elapsedTime)
Updates all of this Sprite's properties. |
Methods inherited from class pulpcore.sprite.Group |
---|
contains, createBackBuffer, createBackBuffer, drawSprite, findWithTag, get, getBackBuffer, getBackBufferBlendMode, getNumSprites, getNumVisibleSprites, getRemovedSprites, hasBackBuffer, isAncestorOf, iterator, pack, pick, pickEnabledAndVisible, propertyChange, removeBackBuffer, setBackBufferBlendMode, size |
Methods inherited from class pulpcore.sprite.Sprite |
---|
bindLocationTo, bindSizeTo, clearCursor, clearDirtyRect, contains, draw, getBlendMode, getCursor, getDirtyRect, getFilter, getLocalX, getLocalY, getParent, getPixelLevelChecks, getRoot, getScene2D, getTag, getViewX, getViewX, getViewY, getViewY, intersects, isDirty, isEnabled, isEnabledAndVisible, isMouseDoubleClicked, isMouseDown, isMouseHover, isMouseOver, isMousePressed, isMouseReleased, isMouseTripleClicked, isMouseWheelRotated, isOpaque, isPick, isPickEnabledAndVisible, isTransparent, move, move, move, move, move, move, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, removeFromParent, scale, scale, scale, scale, scale, scale, scaleTo, scaleTo, scaleTo, scaleTo, scaleTo, scaleTo, setAnchor, setAnchor, setBlendMode, setCursor, setDirty, setFilter, setLocation, setLocation, setSize, setSize, setTag, translate, translate, updateDirtyRect |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final Fixed scrollX
getContentPane().x
.
public final Fixed scrollY
getContentPane().y
.
public final Bool scrollPixelSnapping
true
.
Identical to getContentPane().pixelSnapping
.
Constructor Detail |
---|
public Viewport(int x, int y, int w, int h)
Method Detail |
---|
public Group getContentPane()
public int getContentWidth()
public int getContentHeight()
protected int getNaturalWidth()
Sprite
ImageSprite
, the natural width is the
width of the image.
getNaturalWidth
in class Group
protected int getNaturalHeight()
Sprite
ImageSprite
, the natural height is the
height of the image.
getNaturalHeight
in class Group
public boolean isOverflowClipped()
true
.
isOverflowClipped
in class Group
Group.getNaturalWidth()
,
Group.getNaturalHeight()
public void update(int elapsedTime)
Sprite
update
in class Group
public void add(Sprite sprite)
getContentPane().add(sprite);
.
Adds a Sprite to this Group. The Sprite is added so it appears above all other sprites in this Group. If this Sprite already belongs to a Group, it is first removed from that Group before added to this one.
add
in class Group
public void add(int index, Sprite sprite)
getContentPane().add(index, sprite);
.
Inserts a Sprite to this Group at the specified position. The Sprite at the current position (if any) and any subsequent Sprites are moved up in the z-order (adds one to their indices).
If the index is less than zero, the sprite is inserted at position zero (the bottom in the
z-order).
If the index is greater than or equal to Group.size()
, the sprite is inserted at
position Group.size()
(the top in the z-order).
add
in class Group
public void remove(Sprite sprite)
getContentPane().remove(sprite);
.
Removes a Sprite from this Group.
remove
in class Group
public void removeAll()
getContentPane().removeAll();
.
Removes all Sprites from this Group.
removeAll
in class Group
public void moveToTop(Sprite sprite)
getContentPane().moveToTop(sprite);
.
Moves the specified Sprite to the top of the z-order, so that all the other Sprites currently in this Group appear underneath it. If the specified Sprite is not in this Group, or the Sprite is already at the top, this method does nothing.
moveToTop
in class Group
public void moveToBottom(Sprite sprite)
getContentPane().moveToBottom(sprite);
.
Moves the specified Sprite to the bottom of the z-order, so that all the other Sprites currently in this Group appear above it. If the specified Sprite is not in this Group, or the Sprite is already at the bottom, this method does nothing.
moveToBottom
in class Group
public void moveUp(Sprite sprite)
getContentPane().moveUp(sprite);
.
Moves the specified Sprite up in z-order, swapping places with the first Sprite that appears above it. If the specified Sprite is not in this Group, or the Sprite is already at the top, this method does nothing.
moveUp
in class Group
public void moveDown(Sprite sprite)
getContentPane().moveDown(sprite);
.
Moves the specified Sprite down in z-order, swapping places with the first Sprite that appears below it. If the specified Sprite is not in this Group, or the Sprite is already at the bottom, this method does nothing.
moveDown
in class Group
|
PulpCore | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |