[code] public void renderblock(int x,int y, float size)
{
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex2f(x - size, y + size);
GL11.glVertex2f(x + size, y + size);
GL11.glVertex2f(x + size, y - size);
GL11.glVertex2f(x - size, y - size);
GL11.glEnd();
}
public void rendergame()
{
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
GL11.glLoadIdentity();
object=world.updateworld(object);
for (int ydraw = 12; ydraw < 535; ydraw+=22) {
for (int xdraw = 12; xdraw < 785; xdraw +=22) {
GL11.glColor4f(0.0f, 0.5f, 0.5f,1f);//layer 1:def colour
colourblock((xdraw-12)/22,(ydraw-12)/22);//layer 2: block colour
if (world.mousecont(xdraw,ydraw,mouseX,mouseY,world.getsetting(0))==true)
{
renderblock(xdraw,ydraw,7);
mousegridX=xdraw;mousegridY=ydraw;
}
renderblock(xdraw,ydraw,10);
//GL11.glColor4f(0.0f, 0.5f, 0.5f);
}
}
}[/code]
that is the current gamerenderer. i think the actual drawing is important, so here is that:
public void renderblock(int x,int y, float size)
{
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex2f(x - size, y + size);
GL11.glVertex2f(x + size, y + size);
GL11.glVertex2f(x + size, y - size);
GL11.glVertex2f(x - size, y - size);
GL11.glEnd();
}
then i have world.renderFX, but that is just some mouse-over info, and ads a smaller square to buttons, to show its state (doesn't work yet)
EDIT: nvm, i got it working without the distance thing, thanks though!
i do, however have meany more questions... ill probably start a new topic for that, though.
it looks mutch nicer now, with these transparent boxes!