Modifier and Type | Field and Description |
---|---|
com.badlogic.gdx.graphics.Pixmap |
pixmap |
Constructor and Description |
---|
LibgdxPixmap(com.badlogic.gdx.graphics.Pixmap pixmap) |
Modifier and Type | Method and Description |
---|---|
void |
dispose() |
void |
drawCircle(int x,
int y,
int radius)
Draws a circle outline with the center at x,y and a radius using the current color and stroke width.
|
void |
drawLine(int x,
int y,
int x2,
int y2)
Draws a line between the given coordinates using the currently set color.
|
void |
drawPixel(int x,
int y)
Draws a pixel at the given location with the current color.
|
void |
drawPixel(int x,
int y,
Color color)
Draws a pixel at the given location with the given color.
|
void |
drawPixmap(Pixmap pixmap,
int x,
int y)
Draws an area from another Pixmap to this Pixmap.
|
void |
drawPixmap(Pixmap pixmap,
int x,
int y,
int srcx,
int srcy,
int srcWidth,
int srcHeight)
Draws an area from another Pixmap to this Pixmap.
|
void |
drawPixmap(Pixmap pixmap,
int srcx,
int srcy,
int srcWidth,
int srcHeight,
int dstx,
int dsty,
int dstWidth,
int dstHeight)
Draws an area from another Pixmap to this Pixmap.
|
void |
drawRectangle(int x,
int y,
int width,
int height)
Draws a rectangle outline starting at x, y extending by width to the right and by height downwards (y-axis points downwards)
using the current color.
|
void |
fill()
Fills the complete bitmap with the currently set color.
|
void |
fillCircle(int x,
int y,
int radius)
Fills a circle with the center at x,y and a radius using the current color.
|
void |
fillRectangle(int x,
int y,
int width,
int height)
Fills a rectangle starting at x, y extending by width to the right and by height downwards (y-axis points downwards) using
the current color.
|
void |
fillTriangle(int x1,
int y1,
int x2,
int y2,
int x3,
int y3)
Fills a triangle with vertices at x1,y1 and x2,y2 and x3,y3 using the current color.
|
PixmapBlending |
getBlending() |
PixmapFilter |
getFilter() |
PixmapFormat |
getFormat() |
int |
getHeight() |
int |
getPixel(int x,
int y)
Returns the 32-bit RGBA8888 value of the pixel at x, y.
|
byte[] |
getPixels()
Creates a new byte array holding the pixel data.
|
int |
getWidth() |
void |
setBlending(PixmapBlending blending) |
void |
setColor(Color color)
Sets the color for the following drawing operations
|
void |
setFilter(PixmapFilter filter)
Sets the type of interpolation
PixmapFilter to be used in conjunction with
Pixmap.drawPixmap(Pixmap, int, int, int, int, int, int, int, int) . |
static com.badlogic.gdx.graphics.Pixmap.Format |
toGdxPixmapFormat(PixmapFormat format) |
public void fill()
Pixmap
public void drawLine(int x, int y, int x2, int y2)
Pixmap
public void drawRectangle(int x, int y, int width, int height)
Pixmap
drawRectangle
in interface Pixmap
x
- The x coordinatey
- The y coordinatewidth
- The width in pixelsheight
- The height in pixelspublic void drawPixmap(Pixmap pixmap, int x, int y)
Pixmap
drawPixmap
in interface Pixmap
pixmap
- The other Pixmapx
- The target x-coordinate (top left corner)y
- The target y-coordinate (top left corner)public void drawPixmap(Pixmap pixmap, int x, int y, int srcx, int srcy, int srcWidth, int srcHeight)
Pixmap
drawPixmap
in interface Pixmap
pixmap
- The other Pixmapx
- The target x-coordinate (top left corner)y
- The target y-coordinate (top left corner)srcx
- The source x-coordinate (top left corner)srcy
- The source y-coordinate (top left corner);srcWidth
- The width of the area from the other Pixmap in pixelssrcHeight
- The height of the area from the other Pixmap in pixelspublic void drawPixmap(Pixmap pixmap, int srcx, int srcy, int srcWidth, int srcHeight, int dstx, int dsty, int dstWidth, int dstHeight)
Pixmap
Pixmap.setFilter(PixmapFilter)
to specify the type of filtering to be used (nearest
neighbour or bilinear).drawPixmap
in interface Pixmap
pixmap
- The other Pixmapsrcx
- The source x-coordinate (top left corner)srcy
- The source y-coordinate (top left corner);srcWidth
- The width of the area from the other Pixmap in pixelssrcHeight
- The height of the area from the other Pixmap in pixelsdstx
- The target x-coordinate (top left corner)dsty
- The target y-coordinate (top left corner)dstWidth
- The target widthdstHeight
- the target heightpublic void fillRectangle(int x, int y, int width, int height)
Pixmap
fillRectangle
in interface Pixmap
x
- The x coordinatey
- The y coordinatewidth
- The width in pixelsheight
- The height in pixelspublic void drawCircle(int x, int y, int radius)
Pixmap
drawCircle
in interface Pixmap
x
- The x-coordinate of the centery
- The y-coordinate of the centerradius
- The radius in pixelspublic void fillCircle(int x, int y, int radius)
Pixmap
fillCircle
in interface Pixmap
x
- The x-coordinate of the centery
- The y-coordinate of the centerradius
- The radius in pixelspublic void fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3)
Pixmap
fillTriangle
in interface Pixmap
x1
- The x-coordinate of vertex 1y1
- The y-coordinate of vertex 1x2
- The x-coordinate of vertex 2y2
- The y-coordinate of vertex 2x3
- The x-coordinate of vertex 3y3
- The y-coordinate of vertex 3public void drawPixel(int x, int y)
Pixmap
public void drawPixel(int x, int y, Color color)
Pixmap
public int getPixel(int x, int y)
Pixmap
public byte[] getPixels()
Pixmap
public int getWidth()
public int getHeight()
public PixmapFormat getFormat()
getFormat
in interface Pixmap
PixmapFormat
of this Pixmap.public PixmapBlending getBlending()
getBlending
in interface Pixmap
PixmapBlending
public void setBlending(PixmapBlending blending)
setBlending
in interface Pixmap
public PixmapFilter getFilter()
getFilter
in interface Pixmap
PixmapFilter
public void setFilter(PixmapFilter filter)
Pixmap
PixmapFilter
to be used in conjunction with
Pixmap.drawPixmap(Pixmap, int, int, int, int, int, int, int, int)
.public void setColor(Color color)
Pixmap
public void dispose()
dispose
in interface org.mini2Dx.gdx.utils.Disposable
public static com.badlogic.gdx.graphics.Pixmap.Format toGdxPixmapFormat(PixmapFormat format)