Package engine.util
Class ToolKit
java.lang.Object
engine.util.ToolKit
Static class of util functions along with collision and image manipulation
- Author:
- Nico L. (MrDuckyTesla)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddNotInArray(ArrayList<Integer> a, int[] b) static voidchangeColor(processing.core.PApplet app, processing.core.PImage image, ArrayList<Integer> colorList, int[] tintList) Given the list that is returned from PreCompile(), this function changes the color of input imagestatic voidchangeSingleColor(processing.core.PApplet app, processing.core.PImage image, int[] ogColorRGB, int[] newColorRGB) Takes in an image along with a color from the image and a new color.static processing.core.PImagecircleImage(processing.core.PApplet app, float x, float y, int res, float thickness, float sizeDisplay) static processing.core.PImagecircleImage(processing.core.PApplet app, float x, float y, int res, float thickness, float sizeDisplay, int[] color1) static processing.core.PImagecircleImage(processing.core.PApplet app, float x, float y, int res, float thickness, float sizeDisplay, int[] color1, boolean gradient) static processing.core.PImagecircleImage(processing.core.PApplet app, float x, float y, int res, float thickness, float sizeDisplay, int[] color1, boolean gradient, int[] color2) Returns an image of a circle with varying thickness, resolution, and color (pixelated circle).static booleancircRectCollide(float cx, float cy, float cr, float rx, float ry, float rw, float rh) static voidclearImage(processing.core.PApplet app, processing.core.PImage image) Takes an image and sets its alpha value to 0, making the image completely transparentstatic float[]closestPointLine(float px, float py, float x1, float y1, float x2, float y2) static float[]closestPointLine(float px, float py, float x1, float y1, float x2, float y2, boolean rounded) Finds the closest spot on a line from a pointstatic booleancompareColorColor(int[] col1, int[] col2) static booleancompareColorList(int r, int g, int b, int a, int[] col) static booleancompareListList(float[] list1, float[] list2) Checks if two lines are identicalstatic booleancompareProcessingColorList(processing.core.PApplet app, int color1, int[] color2) static voidcopy(processing.core.PApplet app, processing.core.PImage image1, processing.core.PImage image2) Copies image1 onto image2static booleanfillApp(int r, int g, int b) static processing.core.PAppletgetApp()static intstatic intstatic booleanstatic PointgetImageWH(processing.core.PImage p) static float[]getLimbCoords(float centerX, float centerY, float length1, float length2, float endX, float endY) static float[]getLimbCoords(float centerX, float centerY, float length1, float length2, float endX, float endY, boolean bendRight) Returns a set of coordinates that create an arm with one jointgetNeighbors(E obj, HashMap<Integer, ArrayList<E>> h, int wid, int hgt, int size) getNeighborsRender(E obj, HashMap<Integer, ArrayList<E>> h, int wid, int hgt, int size) static inthash(int x, int y) static booleankeyIsDown(int key) static voidlineDraw(processing.core.PApplet app, float x1, float y1, float x2, float y2) simple version of pixelated line that draws line instead of returning itstatic processing.core.PImagelineImage(processing.core.PApplet app, float x1, float y1, float x2, float y2) static processing.core.PImagelineImage(processing.core.PApplet app, float x1, float y1, float x2, float y2, int res, float thickness, float sizeDisplay) static processing.core.PImagelineImage(processing.core.PApplet app, float x1, float y1, float x2, float y2, int res, float thickness, float sizeDisplay, int[] color) Returns an image of a line with varying thickness, resolution, and color (pixelated line)static float[]lineLineCollide(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) Calculates if and where two lines collidestatic float[]lineRadius(float centerX, float centerY, float endX, float endY, float radius) static float[]lineRadius(float centerX, float centerY, float endX, float endY, float radius, boolean forceRadius) Returns a set of coordinates that keep a line within a certain radiusstatic float[][]lineRectCollide(float x1, float y1, float x2, float y2, float rx, float ry, float rw, float rh) Checks if a line and rectangle collidestatic boolean[]lRectRectCollide(float rx1, float ry1, float rw1, float rh1, float rx2, float ry2, float rw2, float rh2) static booleannotInArray(ArrayList<Integer> a, int[] b) static booleannRectRectCollide(float r1x, float r1y, float r1w, float r1h, float r2x, float r2y, float r2w, float r2h) Checks if rectangle is fully inside another rectanglestatic float[]nRectRectCollideCoords(float px, float py, float x1, float y1, float w1, float h1, float x2, float y2, float w2, float h2) Checks if two rectangles collide and returns the EXACT coordinates that the moving rectangle should be in, except moving rectangle is INSIDE non-moving rectanglestatic processing.core.PImageoutline(processing.core.PApplet app, processing.core.PImage image) static processing.core.PImageoutline(processing.core.PApplet app, processing.core.PImage image, int[] color1) static processing.core.PImageoutline(processing.core.PApplet app, processing.core.PImage image, int[] color1, int[] color2) Returns the image given but with usually a single pixel outline around it (some cases may get 2 pixels, faster than outlineThin tho)static processing.core.PImageoutlineThin(processing.core.PApplet app, processing.core.PImage image) static processing.core.PImageoutlineThin(processing.core.PApplet app, processing.core.PImage image, int[] color1) static processing.core.PImageoutlineThin(processing.core.PApplet app, processing.core.PImage image, int[] color1, int[] color2) Returns the image given but with a single pixel outline around itstatic voidpixelate(processing.core.PApplet app, int res) static voidpixelate(processing.core.PApplet app, int res, float x, float y, float w, float h) Takes a chunk of the PApplet and pixelates it, automatically drawing it over the given area of PAppletstatic voidpixelate(processing.core.PApplet app, processing.core.PImage image, int res) static voidpixelate(processing.core.PApplet app, processing.core.PImage image, int res, float x, float y, float w, float h) Takes a chunk of an image and pixelates it, automatically drawing it over the given area of the imagestatic booleanpLineCollide(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) Checks if two parallel lines are colliding (useful for rectangle collision)static booleanpointCircCollide(float px, float py, float cx, float cy, float cr) static booleanpointRectCollide(float px, float py, float rx, float ry, float rw, float rh) static booleanpointRectCollideNotExact(float px, float py, float rx, float ry, float rw, float rh) static booleanpopApp()PreCompile(processing.core.PApplet app, processing.core.PImage image, int[][] layerList) Precompiles the layers and colors of an image into a liststatic booleanpushApp()static int[]pushBack(int[] a, int b) static <T> T[]pushBack(T[] a, T b) static booleanrectApp(float x, float y, float w, float h) static booleanrectRectCollide(float r1x, float r1y, float r1w, float r1h, float r2x, float r2y, float r2w, float r2h) static float[]rectRectCollideCoords(float px, float py, float x1, float y1, float w1, float h1, float x2, float y2, float w2, float h2) Checks if two rectangles collide and returns the EXACT coordinates that the moving rectangle should be instatic booleanrectRectCollideNotExact(float r1x, float r1y, float r1w, float r1h, float r2x, float r2y, float r2w, float r2h) static <T> ArrayList<T> static voidresetColor(processing.core.PApplet app, processing.core.PImage image, ArrayList<Integer> colorList) Takes in an image that has been recompiled and resets it back to its original colorsstatic booleansetApp(processing.core.PApplet app) static voidsetKey(int key, boolean state) static voidsharpen(processing.core.PApplet app, processing.core.PImage image, int[] backgroundColor, int[] replacementColor) ngl gang i forgot what this one does, I think it was supposed to replace colors with more rangestatic processing.core.PImagesquareImage(processing.core.PApplet app, float x, float y, int res, float thickness, float sizeDisplay) static processing.core.PImagesquareImage(processing.core.PApplet app, float x, float y, int res, float thickness, float sizeDisplay, int[] color1) static processing.core.PImagesquareImage(processing.core.PApplet app, float x, float y, int res, float thickness, float sizeDisplay, int[] color1, boolean gradient) static processing.core.PImagesquareImage(processing.core.PApplet app, float x, float y, int res, float thickness, float sizeDisplay, int[] color1, boolean gradient, int[] color2) Returns an image of squared dimensions with a nice gradient (pixelated circle)static Pointunstick(float[] c) Takes rectRectCollideCoords() list output in and returns a point that can wont get stuck
-
Field Details
-
keys
Stores all keys that are being held down- See Also:
-
app
private static processing.core.PApplet appStores the PApplet being used by all classes- See Also:
-
-
Constructor Details
-
ToolKit
public ToolKit()
-
-
Method Details
-
PreCompile
public static ArrayList<Integer> PreCompile(processing.core.PApplet app, processing.core.PImage image, int[][] layerList) Precompiles the layers and colors of an image into a list- Parameters:
app- PApplet instance that is being usedimage- The (presumably greyscale) spritesheet being compiledlayerList- An array separated by layer holding greyscale colors (EX: [ [a, b, c], [d, e], [f] ],- Returns:
- Returns a 1d ArrayList thats formatted with the index of color, the layer it belongs to, and the color
-
changeColor
public static void changeColor(processing.core.PApplet app, processing.core.PImage image, ArrayList<Integer> colorList, int[] tintList) Given the list that is returned from PreCompile(), this function changes the color of input image- Parameters:
app- PApplet instance that is being usedimage- The (presumably greyscale) spritesheet being recoloredcolorList- List returned from PreCompile()tintList- The color you want to tint the image with in [R, G, B] format
-
changeSingleColor
public static void changeSingleColor(processing.core.PApplet app, processing.core.PImage image, int[] ogColorRGB, int[] newColorRGB) Takes in an image along with a color from the image and a new color. Replaces the old color with a new one- Parameters:
app- PApplet instance that is being usedimage- The image that is getting changedogColorRGB-newColorRGB-
-
resetColor
public static void resetColor(processing.core.PApplet app, processing.core.PImage image, ArrayList<Integer> colorList) Takes in an image that has been recompiled and resets it back to its original colors- Parameters:
app- PApplet instance that is being usedimage- The image that is getting changedcolorList- List returned from PreCompile()
-
clearImage
public static void clearImage(processing.core.PApplet app, processing.core.PImage image) Takes an image and sets its alpha value to 0, making the image completely transparent- Parameters:
app- PApplet instance that is being usedimage- The image that is getting changed
-
pixelate
public static void pixelate(processing.core.PApplet app, int res, float x, float y, float w, float h) Takes a chunk of the PApplet and pixelates it, automatically drawing it over the given area of PApplet- Parameters:
app- PApplet instance that is being usedres- Resolution of pixelated areax- X coordinate indicating where to pixelatey- Y coordinate indicating where to pixelatew- Width of pixelated areah- Height of pixelated area
-
pixelate
public static void pixelate(processing.core.PApplet app, processing.core.PImage image, int res, float x, float y, float w, float h) Takes a chunk of an image and pixelates it, automatically drawing it over the given area of the image- Parameters:
app- PApplet instance that is being usedimage- The image that is getting pixelatedres- Resolution of pixelated areax- X coordinate indicating where to pixelatey- Y coordinate indicating where to pixelatew- Width of pixelated areah- Height of pixelated area
-
lineRadius
public static float[] lineRadius(float centerX, float centerY, float endX, float endY, float radius, boolean forceRadius) Returns a set of coordinates that keep a line within a certain radius- Parameters:
centerX- X coordinate of where the line begins fromcenterY- Y coordinate of where the line begins fromendX- X coordinate of where the line wants to endendY- Y coordinate of where the line wants to endradius- Radius that line must stay withinforceRadius- Boolean that dictates if the line length will be the radius- Returns:
- Set of coordinates in form [X, Y] that should be used instead of endpoint
-
getLimbCoords
public static float[] getLimbCoords(float centerX, float centerY, float length1, float length2, float endX, float endY, boolean bendRight) Returns a set of coordinates that create an arm with one joint- Parameters:
centerX- X coordinate of where the arm begins fromcenterY- Y coordinate of where the arm begins fromlength1- length of the first line that begins on centerX/Ylength2- length of the second line that begins on first lines endendX- X coordinate of where the arm wants to endendY- Y coordinate of where the arm wants to endbendRight- Boolean that dictates if the arms joint bends to the left or right- Returns:
- Set of coordinates in form [X1, Y1, X2, Y2] that should be used as such: line(centerX, centerY, X1, Y1); line(X1, Y1, X2, Y2)
-
copy
public static void copy(processing.core.PApplet app, processing.core.PImage image1, processing.core.PImage image2) Copies image1 onto image2- Parameters:
app- PApplet instance that is being usedimage1- Image that is being overriddenimage2- Source image being used to copy from
-
lineLineCollide
public static float[] lineLineCollide(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) Calculates if and where two lines collide- Parameters:
x1- One of the two X coordinates belonging to line1y1- One of the two Y coordinates belonging to line1x2- One of the two X coordinates belonging to line1y2- One of the two Y coordinates belonging to line1x3- One of the two X coordinates belonging to line2y3- One of the two Y coordinates belonging to line2x4- One of the two X coordinates belonging to line2y4- One of the two Y coordinates belonging to line2- Returns:
- Returns the set of coordinates in form [X, Y] if there is a collision. If there is no collision, returns empty array
-
closestPointLine
public static float[] closestPointLine(float px, float py, float x1, float y1, float x2, float y2, boolean rounded) Finds the closest spot on a line from a point- Parameters:
px- X coordinate of pointpy- Y coordinate of pointx1- One of the two X coordinates belonging to liney1- One of the two Y coordinates belonging to linex2- One of the two X coordinates belonging to liney2- One of the two Y coordinates belonging to linerounded- boolean that dictates if points towards the end of a line form sharp corners or not- Returns:
- Returns the set of coordinates in form [X, Y] of the nearest point on the line
-
lineImage
public static processing.core.PImage lineImage(processing.core.PApplet app, float x1, float y1, float x2, float y2, int res, float thickness, float sizeDisplay, int[] color) Returns an image of a line with varying thickness, resolution, and color (pixelated line)- Parameters:
app- PApplet instance that is being usedx1- One of the two X coordinates belonging to liney1- One of the two Y coordinates belonging to linex2- One of the two X coordinates belonging to liney2- One of the two Y coordinates belonging to lineres- Resolution of line in pixelsthickness- How thick the line should besizeDisplay- Size to display line atcolor- Color of line in [R, G, B, A] format- Returns:
- image that contains pixelated line
-
lineDraw
public static void lineDraw(processing.core.PApplet app, float x1, float y1, float x2, float y2) simple version of pixelated line that draws line instead of returning it- Parameters:
app- PApplet instance that is being usedx1- One of the two X coordinates belonging to liney1- One of the two Y coordinates belonging to linex2- One of the two X coordinates belonging to liney2- One of the two Y coordinates belonging to line
-
circleImage
public static processing.core.PImage circleImage(processing.core.PApplet app, float x, float y, int res, float thickness, float sizeDisplay, int[] color1, boolean gradient, int[] color2) Returns an image of a circle with varying thickness, resolution, and color (pixelated circle). Can have gradient too- Parameters:
app- PApplet instance that is being usedx- Center X coordinate of circley- Center Y coordinate of circleres- Resolution of circle in pixelsthickness- Radius of circlesizeDisplay- Size to display circle atcolor1- Color of circle in [R, G, B, A] formatgradient- Boolean that dictated if there is a gradientcolor2- Color of circle gradient in [R, G, B, A] format- Returns:
- image that contains pixelated circle
-
squareImage
public static processing.core.PImage squareImage(processing.core.PApplet app, float x, float y, int res, float thickness, float sizeDisplay, int[] color1, boolean gradient, int[] color2) Returns an image of squared dimensions with a nice gradient (pixelated circle)- Parameters:
app- PApplet instance that is being usedx- Center X coordinate of squarey- Center Y coordinate of squareres- Resolution of square in pixelsthickness- Radius of squaresizeDisplay- Size to display square atcolor1- Color of square in [R, G, B, A] formatgradient- Boolean that dictated if there is a gradientcolor2- Color of square gradient in [R, G, B, A] format- Returns:
- image of squared dimensions with a nice gradient
-
outline
public static processing.core.PImage outline(processing.core.PApplet app, processing.core.PImage image, int[] color1, int[] color2) Returns the image given but with usually a single pixel outline around it (some cases may get 2 pixels, faster than outlineThin tho)- Parameters:
app- PApplet instance that is being usedimage- Image that is getting outlinedcolor1- Color of background in [R, G, B, A] formatcolor2- Color of outline in [R, G, B, A] format- Returns:
- Image with outline
-
outlineThin
public static processing.core.PImage outlineThin(processing.core.PApplet app, processing.core.PImage image, int[] color1, int[] color2) Returns the image given but with a single pixel outline around it- Parameters:
app- PApplet instance that is being usedimage- Image that is getting outlinedcolor1- Color of background in [R, G, B, A] formatcolor2- Color of outline in [R, G, B, A] format- Returns:
- Image with outline
-
sharpen
public static void sharpen(processing.core.PApplet app, processing.core.PImage image, int[] backgroundColor, int[] replacementColor) ngl gang i forgot what this one does, I think it was supposed to replace colors with more range- Parameters:
app- PApplet instance that is being usedimage- Image that is getting changedbackgroundColor- Color of background in [R, G, B, A] formatreplacementColor- Color of replacement in [R, G, B, A] format
-
rectRectCollideCoords
public static float[] rectRectCollideCoords(float px, float py, float x1, float y1, float w1, float h1, float x2, float y2, float w2, float h2) Checks if two rectangles collide and returns the EXACT coordinates that the moving rectangle should be in- Parameters:
px- Previous X coordinate of moving rectanglepy- Previous Y coordinate of moving rectanglex1- Current X coordinate of moving rectangley1- Current X coordinate of moving rectanglew1- Width of moving rectangleh1- Height of moving rectanglex2- Current X coordinate of non-moving rectangley2- Current Y coordinate of non-moving rectanglew2- Width of non-moving rectangleh2- Height of non-moving rectangle- Returns:
- Coordinates in form of [X, Y, SIDE] with SIDE being which side the moving rectangle collided with (0 is top, 1 is right, 2 is bottom, 3 is left)
-
nRectRectCollideCoords
public static float[] nRectRectCollideCoords(float px, float py, float x1, float y1, float w1, float h1, float x2, float y2, float w2, float h2) Checks if two rectangles collide and returns the EXACT coordinates that the moving rectangle should be in, except moving rectangle is INSIDE non-moving rectangle- Parameters:
px- Previous X coordinate of moving rectanglepy- Previous Y coordinate of moving rectanglex1- Current X coordinate of moving rectangley1- Current X coordinate of moving rectanglew1- Width of moving rectangleh1- Height of moving rectanglex2- Current X coordinate of non-moving rectangley2- Current Y coordinate of non-moving rectanglew2- Width of non-moving rectangleh2- Height of non-moving rectangle- Returns:
- Coordinates in form of [X, Y, SIDE] with SIDE being which side the moving rectangle collided with (0 is top, 1 is right, 2 is bottom, 3 is left)
-
nRectRectCollide
public static boolean nRectRectCollide(float r1x, float r1y, float r1w, float r1h, float r2x, float r2y, float r2w, float r2h) Checks if rectangle is fully inside another rectangle- Parameters:
r1x- First rectangles X coordinater1y- First rectangles Y coordinater1w- First rectangles Widthr1h- First rectangles Heightr2x- Second rectangles X coordinater2y- Second rectangles Y coordinater2w- Second rectangles Widthr2h- Second rectangles Height- Returns:
- Boolean that represents if rectangle is fully inside another rectangle
-
pLineCollide
public static boolean pLineCollide(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) Checks if two parallel lines are colliding (useful for rectangle collision)- Parameters:
x1- One of the two X coordinates belonging to first liney1- One of the two Y coordinates belonging to first linex2- One of the two X coordinates belonging to first liney2- One of the two Y coordinates belonging to first linex3- One of the two X coordinates belonging to second liney3- One of the two Y coordinates belonging to second linex4- One of the two X coordinates belonging to second liney4- One of the two Y coordinates belonging to second line- Returns:
- Boolean representing if colliding with other line
-
compareListList
public static boolean compareListList(float[] list1, float[] list2) Checks if two lines are identical- Parameters:
list1- First list to comparelist2- Second list to compare- Returns:
- Boolean representing if lists are same
-
unstick
Takes rectRectCollideCoords() list output in and returns a point that can wont get stuck- Parameters:
c- rectRectCollideCoords() output- Returns:
- New unstuck point
- See Also:
-
lineRectCollide
public static float[][] lineRectCollide(float x1, float y1, float x2, float y2, float rx, float ry, float rw, float rh) Checks if a line and rectangle collide- Parameters:
x1-y1-x2-y2-rx-ry-rw-rh-- Returns:
-
lRectRectCollide
public static boolean[] lRectRectCollide(float rx1, float ry1, float rw1, float rh1, float rx2, float ry2, float rw2, float rh2) - Parameters:
rx1-ry1-rw1-rh1-rx2-ry2-rw2-rh2-- Returns:
-
rectRectCollide
public static boolean rectRectCollide(float r1x, float r1y, float r1w, float r1h, float r2x, float r2y, float r2w, float r2h) - Parameters:
r1x-r1y-r1w-r1h-r2x-r2y-r2w-r2h-- Returns:
-
rectRectCollideNotExact
public static boolean rectRectCollideNotExact(float r1x, float r1y, float r1w, float r1h, float r2x, float r2y, float r2w, float r2h) - Parameters:
r1x-r1y-r1w-r1h-r2x-r2y-r2w-r2h-- Returns:
-
circRectCollide
public static boolean circRectCollide(float cx, float cy, float cr, float rx, float ry, float rw, float rh) - Parameters:
cx-cy-cr-rx-ry-rw-rh-- Returns:
-
pointRectCollide
public static boolean pointRectCollide(float px, float py, float rx, float ry, float rw, float rh) - Parameters:
px-py-rx-ry-rw-rh-- Returns:
-
pointRectCollideNotExact
public static boolean pointRectCollideNotExact(float px, float py, float rx, float ry, float rw, float rh) - Parameters:
px-py-rx-ry-rw-rh-- Returns:
-
pointCircCollide
public static boolean pointCircCollide(float px, float py, float cx, float cy, float cr) - Parameters:
px-py-cx-cy-cr-- Returns:
-
compareProcessingColorList
public static boolean compareProcessingColorList(processing.core.PApplet app, int color1, int[] color2) - Parameters:
app-color1-color2-- Returns:
-
compareColorList
public static boolean compareColorList(int r, int g, int b, int a, int[] col) - Parameters:
r-g-b-a-col-- Returns:
-
compareColorColor
public static boolean compareColorColor(int[] col1, int[] col2) - Parameters:
col1-col2-- Returns:
-
getImageWH
- Parameters:
p-- Returns:
-
pixelate
public static void pixelate(processing.core.PApplet app, int res) - Parameters:
app-res-
-
pixelate
public static void pixelate(processing.core.PApplet app, processing.core.PImage image, int res) - Parameters:
app-image-res-
-
lineRadius
public static float[] lineRadius(float centerX, float centerY, float endX, float endY, float radius) - Parameters:
centerX-centerY-endX-endY-radius-- Returns:
-
getLimbCoords
public static float[] getLimbCoords(float centerX, float centerY, float length1, float length2, float endX, float endY) - Parameters:
centerX-centerY-length1-length2-endX-endY-- Returns:
-
closestPointLine
public static float[] closestPointLine(float px, float py, float x1, float y1, float x2, float y2) - Parameters:
px-py-x1-y1-x2-y2-- Returns:
-
lineImage
public static processing.core.PImage lineImage(processing.core.PApplet app, float x1, float y1, float x2, float y2, int res, float thickness, float sizeDisplay) - Parameters:
app-x1-y1-x2-y2-res-thickness-sizeDisplay-- Returns:
-
lineImage
public static processing.core.PImage lineImage(processing.core.PApplet app, float x1, float y1, float x2, float y2) - Parameters:
app-x1-y1-x2-y2-- Returns:
-
circleImage
public static processing.core.PImage circleImage(processing.core.PApplet app, float x, float y, int res, float thickness, float sizeDisplay, int[] color1, boolean gradient) - Parameters:
app-x-y-res-thickness-sizeDisplay-color1-gradient-- Returns:
-
circleImage
public static processing.core.PImage circleImage(processing.core.PApplet app, float x, float y, int res, float thickness, float sizeDisplay, int[] color1) - Parameters:
app-x-y-res-thickness-sizeDisplay-color1-- Returns:
-
circleImage
public static processing.core.PImage circleImage(processing.core.PApplet app, float x, float y, int res, float thickness, float sizeDisplay) - Parameters:
app-x-y-res-thickness-sizeDisplay-- Returns:
-
squareImage
public static processing.core.PImage squareImage(processing.core.PApplet app, float x, float y, int res, float thickness, float sizeDisplay, int[] color1, boolean gradient) - Parameters:
app-x-y-res-thickness-sizeDisplay-color1-gradient-- Returns:
-
squareImage
public static processing.core.PImage squareImage(processing.core.PApplet app, float x, float y, int res, float thickness, float sizeDisplay, int[] color1) - Parameters:
app-x-y-res-thickness-sizeDisplay-color1-- Returns:
-
squareImage
public static processing.core.PImage squareImage(processing.core.PApplet app, float x, float y, int res, float thickness, float sizeDisplay) - Parameters:
app-x-y-res-thickness-sizeDisplay-- Returns:
-
outline
public static processing.core.PImage outline(processing.core.PApplet app, processing.core.PImage image, int[] color1) - Parameters:
app-image-color1-- Returns:
-
outline
public static processing.core.PImage outline(processing.core.PApplet app, processing.core.PImage image) - Parameters:
app-image-- Returns:
-
outlineThin
public static processing.core.PImage outlineThin(processing.core.PApplet app, processing.core.PImage image, int[] color1) - Parameters:
app-image-color1-- Returns:
-
outlineThin
public static processing.core.PImage outlineThin(processing.core.PApplet app, processing.core.PImage image) - Parameters:
app-image-- Returns:
-
removeAll
- Type Parameters:
T-- Parameters:
val-arr-- Returns:
-
keyIsDown
public static boolean keyIsDown(int key) - Parameters:
key-- Returns:
-
setKey
public static void setKey(int key, boolean state) - Parameters:
key-state-
-
pushBack
public static <T> T[] pushBack(T[] a, T b) - Type Parameters:
T-- Parameters:
a-b-- Returns:
-
pushBack
public static int[] pushBack(int[] a, int b) - Parameters:
a-b-- Returns:
-
notInArray
- Parameters:
a-b-- Returns:
-
addNotInArray
- Parameters:
a-b-- Returns:
-
add
- Parameters:
a-b-- Returns:
-
hash
public static int hash(int x, int y) - Parameters:
x-y-- Returns:
-
getNeighbors
public static <E extends Entity> ArrayList<E> getNeighbors(E obj, HashMap<Integer, ArrayList<E>> h, int wid, int hgt, int size) - Type Parameters:
E-- Parameters:
obj-h-wid-hgt-size-- Returns:
-
getNeighborsRender
public static <E extends Entity> ArrayList<E> getNeighborsRender(E obj, HashMap<Integer, ArrayList<E>> h, int wid, int hgt, int size) - Type Parameters:
E-- Parameters:
obj-h-wid-hgt-size-- Returns:
-
getApp
public static processing.core.PApplet getApp()- Returns:
-
getAppWidth
public static int getAppWidth()- Returns:
-
getAppHeight
public static int getAppHeight()- Returns:
-
getHasApp
public static boolean getHasApp()- Returns:
-
setApp
public static boolean setApp(processing.core.PApplet app) - Parameters:
app-- Returns:
-
pushApp
public static boolean pushApp()- Returns:
-
popApp
public static boolean popApp()- Returns:
-
fillApp
public static boolean fillApp(int r, int g, int b) - Parameters:
r-g-b-- Returns:
-
rectApp
public static boolean rectApp(float x, float y, float w, float h) - Parameters:
x-y-w-h-- Returns:
-