Package dev.cerus.maps.api.graphics
Class StandaloneMapGraphics
java.lang.Object
dev.cerus.maps.api.graphics.MapGraphics<MapGraphics<?,?>,Vec2>
dev.cerus.maps.api.graphics.StandaloneMapGraphics
Graphics implementation that's completely standalone and versatile. Could be used for sprites for example.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionMapGraphics<MapGraphics<?,?>,Vec2>
copy()
Make a copy of this bufferstatic StandaloneMapGraphics
copyOf(MapGraphics<?,?> graphics)
byte[]
int
Get the height in pixels of this bufferbyte
getPixel(int x, int y)
Get a pixelint
getWidth()
Get the width in pixels of this buffervoid
renderOnto(MapGraphics<?,?> renderTarget, Vec2 params)
Basically copies this buffer onto the buffer of the specified render targetbyte
setPixel(int x, int y, float alpha, byte color)
Set a pixelMethods inherited from class dev.cerus.maps.api.graphics.MapGraphics
applyFilterToArea, boxBlur, boxBlur, boxBlur, boxBlur, calculateComposite, composite, compositeAtop, compositeIn, compositeOut, compositeOver, compositeXor, drawEllipse, drawEllipse, drawImage, drawLine, drawLine, drawLineX, drawLineY, drawRect, drawText, drawText, fill, fillComplete, fillRect, fillWithBuffer, grayscale, hasDirectAccessCapabilities, index, index, isTransparent, newGraphicsObject, normalizeAlpha, place, place, place, renderOnto, replace, setPixel, standalone
-
Constructor Details
-
StandaloneMapGraphics
public StandaloneMapGraphics(int width, int height)
-
-
Method Details
-
copyOf
-
setPixel
public byte setPixel(int x, int y, float alpha, byte color)Description copied from class:MapGraphics
Set a pixel- Specified by:
setPixel
in classMapGraphics<MapGraphics<?,?>,Vec2>
- Parameters:
x
- The x coordinatey
- The y coordinatealpha
- The pixel alphacolor
- The pixel color- Returns:
- The old pixel color. Might return the specified color if the method does not end up setting the pixel.
-
getPixel
public byte getPixel(int x, int y)Description copied from class:MapGraphics
Get a pixel- Specified by:
getPixel
in classMapGraphics<MapGraphics<?,?>,Vec2>
- Parameters:
x
- The x coordinatey
- The y coordinate- Returns:
- The pixels color
-
renderOnto
Description copied from class:MapGraphics
Basically copies this buffer onto the buffer of the specified render target- Specified by:
renderOnto
in classMapGraphics<MapGraphics<?,?>,Vec2>
- Parameters:
renderTarget
- The render targetparams
- The render parameters
-
copy
Description copied from class:MapGraphics
Make a copy of this buffer- Specified by:
copy
in classMapGraphics<MapGraphics<?,?>,Vec2>
- Returns:
- A copy of this buffer
-
getDirectAccessData
public byte[] getDirectAccessData()- Overrides:
getDirectAccessData
in classMapGraphics<MapGraphics<?,?>,Vec2>
-
getWidth
public int getWidth()Description copied from class:MapGraphics
Get the width in pixels of this buffer- Specified by:
getWidth
in classMapGraphics<MapGraphics<?,?>,Vec2>
- Returns:
- The width
-
getHeight
public int getHeight()Description copied from class:MapGraphics
Get the height in pixels of this buffer- Specified by:
getHeight
in classMapGraphics<MapGraphics<?,?>,Vec2>
- Returns:
- The height
-