Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com> Co-authored-by: sigonasr2 <sigonasr2@gmail.com>main
parent
cedd064da6
commit
121dc6acb6
@ -0,0 +1,28 @@ |
||||
package sig; |
||||
|
||||
import sig.engine.Panel; |
||||
import sig.engine.Sprite; |
||||
|
||||
public class DrawLoop { |
||||
public static Panel panel; |
||||
public static void drawGame(Panel panel) { |
||||
DrawLoop.panel=panel; |
||||
int[] p = panel.pixel; |
||||
|
||||
for (int y=0;y<panel.getHeight();y++) { |
||||
for (int x=0;x<panel.getWidth();x++) { |
||||
p[y*panel.getWidth()+x]=(0<<16)+(0<<8)+0;//RGB
|
||||
} |
||||
} |
||||
Draw_Sprite(panel.nanaX,panel.nanaY,Sprite.NANA); |
||||
} |
||||
|
||||
public static void Draw_Sprite(double x, double y, Sprite sprite){ |
||||
int[] p = panel.pixel; |
||||
for(int X=0;X<sprite.getHeight();X++){ |
||||
for(int Y=0;Y<sprite.getWidth();Y++){ |
||||
p[(Y+(int)y)*panel.getWidth()+X+(int)x] = sprite.getBi_array()[Y*sprite.getWidth()+X]; |
||||
} |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue