public final class JHelpSprite
extends java.lang.Object
JHelpImage.createSprite(int, int, int, int)
Modifier and Type | Field and Description |
---|---|
private JHelpImage |
back
Back image before show the sprite
|
private int |
height
Sprite height
|
private JHelpImage |
image
Image draw on the sprite
|
private JHelpImage |
parent
Parent that contains the sprite
|
private int |
spriteIndex
Sprite index in the parent
|
private boolean |
visible
Indicates actual visibility
|
private int |
width
Sprite width
|
private int |
x
Sprite X
|
private int |
y
Sprite Y
|
Constructor and Description |
---|
JHelpSprite(int x,
int y,
int width,
int height,
JHelpImage parent,
int spriteIndex)
Create a new instance of JHelpSprite
|
JHelpSprite(int x,
int y,
JHelpImage source,
JHelpImage parent,
int spriteIndex)
Create a new instance of JHelpSprite
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
changeVisible(boolean visible,
boolean forced)
Change internally the sprite visibility
|
protected void |
finalize()
Call by garbage collector when want free some memory
Parent documentation: |
int |
getHeight()
Sprite height
|
JHelpImage |
getImage()
Image for draw on the sprite
|
JHelpImage |
getParent()
The sprite parent.
|
(package private) int |
getSpriteIndex()
Sprite index
|
int |
getWidth()
Sprite width
|
int |
getX()
X position
|
int |
getY()
Y position
|
boolean |
isVisible()
Indicates if sprite is visible
|
(package private) void |
setParent(JHelpImage parent)
Change parent image
|
void |
setPosition(int x,
int y)
Change sprite position
|
(package private) void |
setSpriteIndex(int spriteIndex)
Change sprite index
|
void |
setVisible(boolean visible)
Change sprite visibility
|
void |
translate(int vx,
int vy)
Translate the sprite
|
private JHelpImage back
private final int height
private JHelpImage image
private JHelpImage parent
private int spriteIndex
private boolean visible
private final int width
private int x
private int y
JHelpSprite(int x, int y, int width, int height, JHelpImage parent, int spriteIndex)
x
- Start Xy
- Start Ywidth
- Sprite widthheight
- Sprite heightparent
- Image parentspriteIndex
- Sprite indexJHelpSprite(int x, int y, JHelpImage source, JHelpImage parent, int spriteIndex)
x
- X start positiony
- Y start positionsource
- Image sourceparent
- Image parentspriteIndex
- Sprite indexvoid changeVisible(boolean visible, boolean forced)
visible
- New visible stateforced
- Indicates if the change is forcedint getSpriteIndex()
void setParent(JHelpImage parent)
parent
- New parent imagevoid setSpriteIndex(int spriteIndex)
spriteIndex
- New sprite indexprotected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- On issueObject.finalize()
public int getHeight()
public JHelpImage getImage()
public JHelpImage getParent()
JHelpImage
where the sprite is attach topublic int getWidth()
public int getX()
public int getY()
public boolean isVisible()
true
if sprite is visiblepublic void setPosition(int x, int y)
x
- New Xy
- New Ypublic void setVisible(boolean visible)
visible
- New visible statepublic void translate(int vx, int vy)
vx
- X of translation vectorvy
- Y of translation vector