📄 help.java
字号:
import javax.microedition.lcdui.*;
public class Help
{
Image helpImg1=null;
Image helpImg2=null;
Image pointImg=null;
boolean upMove=false;
boolean downMove=false;
int helpImg2Y=38;
AcCV ac=null;
public Help(AcCV ac)
{
this.ac= ac;
initRes();
}
public void initRes()
{
try
{
helpImg1=Image.createImage("/help1.png");
helpImg2=Image.createImage("/help3.png");
pointImg=Image.createImage("/point.png");
}
catch(Exception e)
{
System.out.println("helpScreen图片错误");
e.printStackTrace();
}
}
public void paint(Graphics g)
{
g.setClip(0, 0, ac.getWidth(), ac.getHeight());
g.setColor(0x000000);
g.fillRect(0, 0, ac.getWidth(), ac.getHeight());
g.drawImage(helpImg1, (ac.getWidth()-helpImg1.getWidth())/2, (ac.getHeight()-helpImg1.getHeight())/2, 0);
if(helpImg2Y+helpImg2.getHeight()>=168)
g.drawImage(pointImg, (ac.getWidth()-pointImg.getWidth())/2, (ac.getHeight()-helpImg1.getHeight())/2+162, 0);
g.setClip((ac.getWidth()-helpImg1.getWidth())/2, (ac.getHeight()-helpImg1.getHeight())/2+38, 180, 120);
g.drawImage(helpImg2, (ac.getWidth()-helpImg1.getWidth())/2, (ac.getHeight()-helpImg1.getHeight())/2+helpImg2Y, 0);
if(downMove==true&&helpImg2Y+helpImg2.getHeight()>=168)
{
helpImg2Y--;
}
else if(upMove==true&&helpImg2Y<=38)
{
helpImg2Y++;
}
}
public void recycleRes()
{
helpImg1=null;
helpImg2=null;
pointImg=null;
ac=null;
}
public void processEvent(int key)
{
if(key==0)
{
upMove=false;
downMove=false;
}
else if(ac.getGameAction(key)==AcCV.UP||AcCV.KEY_NUM2==key)
{
upMove=true;
downMove=false;
}
else if(ac.getGameAction(key)==AcCV.DOWN||AcCV.KEY_NUM8==key)
{
downMove=true;
upMove=false;
}
}
public void processEvent()
{
AcCV.state=1;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -