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

📄 graphicswrapperwrapper.java

📁 手机游戏 JSol prototype J2ME源代码+详细注释
💻 JAVA
字号:
package de.tsr.jsol.gui;

import javax.microedition.lcdui.Image;

public class GraphicsWrapperWrapper implements IGraphicsWrapper{
	private IGraphicsWrapper _g;
	private int _xOffset;
	private int _yOffset;
	
	public GraphicsWrapperWrapper(GraphicsWrapper g, int xOffset, int yOffset ) {
		_g = g;
		_xOffset = xOffset;
		_yOffset = yOffset;
	}

	public GraphicsWrapperWrapper(IGraphicsWrapper g, int xOffset, int yOffset ) {
		_g = g;
		_xOffset = xOffset;
		_yOffset = yOffset;
	}

	public void drawRect( int x, int y, int w, int h ) {
		_g.drawRect( _xOffset+x, _yOffset+y, w, h );
	}
	
	public void drawString( String text, int x, int y, int anchor ) {
		_g.drawString( text, _xOffset+x, _yOffset+y, anchor );
	}
	
	public void setColor( int r, int g, int b ) {
		_g.setColor( r, g, b );
	}
	
	public void clearRect( int x, int y, int w, int h ) {
		_g.setColor( 255,255,255 );
		_g.fillRect(_xOffset+x,_yOffset+y,w,h);
		_g.setColor( 0,0,0 );
	}
	
	public void fillRect(int x, int y, int w, int h) {
		_g.fillRect(_xOffset+x,_yOffset+y,w,h);
	}	
	
	public void setStrokeStyle(int style) {
		_g.setStrokeStyle(style);
	}
	
    public void drawImage(Image image, int x, int y, int anchor) {
        _g.drawImage(image,_xOffset+ x, _yOffset+ y, anchor);
    }
}

⌨️ 快捷键说明

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