drawTextColor method

void drawTextColor(
  1. String text,
  2. int x,
  3. int y,
  4. int color,
  5. bool right,
)

Implementation

void drawTextColor( String text, int x, int y, int color, bool right ){
	gWorldTextColor( this, text, x, y, color, right );
	_gWorldPut = false;

	_imgMoveX = x;
	_imgMoveY = y;

	int xx, yy;
	int top;

	int chr;
	for( int i = 0; i < text.length; i++ ){
		chr = ClipMath.charCodeAt( text, right ? text.length - 1 - i : i );
		if( _charInfo[_charSet][chr]._data != null ){
			if( right ){
				// 現在点を移動させる
				_imgMoveX -= _charInfo[_charSet][chr]._width;
			}

			// 文字の描画
			top = 0;
			for( yy = _imgMoveY - _charInfo[_charSet][chr]._sizeY; ; yy++ ){
				for( xx = 0; xx < _charInfo[_charSet][chr]._sizeX; xx++ ){
					if( _charInfo[_charSet][chr]._data!.length == top + xx ){
						break;
					}
					if( ClipMath.charAt( _charInfo[_charSet][chr]._data!, top + xx ) == '1' ){
						putColor( _imgMoveX + xx, yy, color );
					}
				}
				if( _charInfo[_charSet][chr]._data!.length == top + xx ){
					break;
				}
				top += _charInfo[_charSet][chr]._sizeX;
			}

			if( !right ){
				// 現在点を移動させる
				_imgMoveX += _charInfo[_charSet][chr]._width;
			}
		}
	}

	// 現在点の更新に伴う処理
	_wndMoveX = wndPosX( _imgMoveX );

	_gWorldPut = true;
}