i have path2d.double()
shape , know how place image on shape. ideally looking api can me, method not ridiculously complicated should fine.
the shape wish draw upon 2d isometric cube (in example code cube not rotated therefore not isometric thats not problem), if of useful infomation anyone, , create shape follows
trying add png / jpg image (dosent matter can convert between two) of brick image. dont think matters content of image is.
path2d shape = new path2d.double(); shape.moveto(x, y); for(int i=0; i<xcords.length;i++){ shape.lineto(xcords[i], ycords[i]); } shape.closepath();
code re-create scenario
import java.awt.*; import java.awt.geom.path2d; import javax.swing.*; public class main extends jpanel { static int width; static int height; path2d shape; int[] xcords = {0,100,100, 0, 0, 0, 0, 0, 0, 0,100,100, 0, 0, 0, 100,100, 0, 0,100,100,100,100,100,100, 0, 0,100, 0, 0, 0}; int[] ycords = {0, 0,100,100, 0, 0,100,100, 0, 0, 0, 0, 0, 0,100, 100, 0, 0,100,100,100, 0, 0,100,100,100,100,100, 100, 0, 0}; int[] zcords = {0, 0, 0, 0, 0,100,100, 0, 0,100,100, 0, 0, 100,100, 100,100,100,100,100, 0, 0,100,100, 0, 0,100,100, 100,100, 0}; public main(){ shape = new path2d.double(); shape.moveto(300, 300); (int i=0; i<xcords.length;i++){ xcords[i] = xcords[i] - zcords[i]; ycords[i] = ycords[i] - zcords[i]; } (int i=0; i<xcords.length;i++){ shape.lineto(300+xcords[i],300+ycords[i]); } shape.closepath(); } public void paintcomponent(graphics g){ super.paintcomponent(g); graphics2d g2d = (graphics2d) g; g2d.draw(shape); } public static void main(string[] args){ dimension screensize = toolkit.getdefaulttoolkit().getscreensize(); width = (int) screensize.getwidth(); height = (int) screensize.getheight(); main main = new main(); jframe frame = new jframe(); frame.settitle("360 attack"); frame.setsize(width, height); frame.setdefaultcloseoperation(jframe.exit_on_close); frame.setundecorated(true); frame.add(main); frame.setvisible(true); } }