📄 rectangle.java
字号:
import javax.microedition.lcdui.Graphics;
/*
* 地图上的场景,方块,长条等等
* */
public class Rectangle {
int x, y, w, h;
boolean fd = false;
public Rectangle(int x,int y,int w,int h,boolean fd)
{
this.x = x;
this.y = y;
this.w = w;
this.h = h;
this.fd = fd;
}
public void draw(Graphics g, int x, int y, int w, int h, boolean fd)
{
this.x = x;
this.y = y;
this.w = w;
this.h = h;
this.fd = fd;
if (fd)
g.fillRect(this.x, this.y, this.w, this.h);//实心物体
else
g.drawRect(this.x, this.y, this.w, this.h);//空心物体
}
public int getX()
{
return x;
}
public int getY()
{
return y;
}
public int getW()
{
return w;
}
public int getH()
{
return h;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -