⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 graphicseffects.java

📁 j2me手机游戏光盘文件 压缩包里有说明文件
💻 JAVA
字号:

import javax.microedition.lcdui.*;
class GraphicsEffects
{
	private static GraphicsEffects instance;
	private GraphicsEffects()
	{ 
	}
	static GraphicsEffects getInstance()
    {
        if (instance == null)
        {
            instance = new GraphicsEffects();
        }
        return instance;
    }

	public void drawClipImage(Graphics g,Image a,int clipX,int clipY,int clipW,int clipH,int offx,int offy)
	{
		int x,y,cw,ch;
		x=g.getClipX();
		y=g.getClipY();
		cw=g.getClipWidth();
		ch=g.getClipHeight();
		g.setClip(clipX,clipY,clipW,clipH);
		g.drawImage(a,clipX-offx,clipY-offy,0);
		g.setClip(x,y,cw,ch);
	}	

	public void drawStringShadow(Graphics g, int mainColor, int topColor, int bottomColor, String str, int x, int y, int anchor)
	{  
      g.setFont(MenuCanvas.mFont);                 
    	g.setColor(topColor);   
    	g.drawString(str,x-1,y,anchor);   
    	g.drawString(str,x,y-1,anchor);   
    	g.drawString(str,x-1,y-1,anchor);
      g.setColor(bottomColor); 
      g.drawString(str,x+1,y,anchor); 
      g.drawString(str,x,y+1,anchor);
      g.drawString(str,x+1,y+1,anchor);
      g.setColor(mainColor);
      g.drawString(str,x,y,anchor); 
  }	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -