
unit Sprite
{
	link memory linka {} = #.linker.linka;
	
	//[i] linksysconst_uint8 ID;
	public const uint8 ID = 0;
	//[i] var_int32 Id;
	public int32 Id;
	
	//[i] var_int32_w X;
	public linka int32 X = #addr ID * 0x0100 + 0x01;
	//[i] var_int32_w Y;
	public linka int32 Y = #addr ID * 0x0100 + 0x02;
	//[i] var_int32_w Width;
	public linka int32 Width = #addr ID * 0x0100 + 0x03;
	//[i] var_int32_w Height;
	public linka int32 Height = #addr ID * 0x0100 + 0x04;
	///[i] var_int32_w BackColor;
	///public linka int32 BackColor = #addr ID * 0x0100 + 0x05;
	///[i] var_int32_w ForeColor;
	///public linka int32 ForeColor = #addr ID * 0x0100 + 0x06;
	
	//[i] var_int32_w OS_RolX;
	public linka int32 OS_RolX = #addr ID * 0x0100 + 0x09;
	//[i] var_int32_w OS_RolY;
	public linka int32 OS_RolY = #addr ID * 0x0100 + 0x0A;

	//[i] var_int32_w Angle;
	public linka int32 Angle = #addr ID * 0x0100 + 0x41;
	//[i] var_int32_w Scale;
	public linka int32 Scale = #addr ID * 0x0100 + 0x40;
	//[i] var_int32_w XScale;
	public linka int32 XScale = #addr ID * 0x0100 + 0x42;
	//[i] var_int32_w YScale;
	public linka int32 YScale = #addr ID * 0x0100 + 0x43;
	//[i] var_int32_w Opacity;
	public linka int32 Opacity = #addr ID * 0x0100 + 0x44;
	//[i] var_int32_w ImageIndex;
	public linka int32 ImageIndex = #addr ID * 0x0100 + 0x45;
	//[i] var_bool_w Alive;
	public linka bool Alive = #addr ID * 0x0100 + 0x46;

	//[i] var_int32_w HitID;
	public linka int32 HitID = #addr ID * 0x0100 + 0x50;
	//[i] var_int32_w OS_EageHitType;
	public linka int32 OS_EageHitType = #addr ID * 0x0100 + 0x51;
	//[i] var_bool_w Hited;
	public linka bool Hited = #addr ID * 0x0100 + 0x52;
	//[i] var_int32_w Bounce;
	public linka int32 Bounce = #addr ID * 0x0100 + 0x53;
	
	//[i] var_int32_w XSpeed;
	public linka int32 XSpeed = #addr ID * 0x0100 + 0x54;
	//[i] var_int32_w YSpeed;
	public linka int32 YSpeed = #addr ID * 0x0100 + 0x55;
	
	//[i] var_int32_w OS_FowardAngle;
	public linka int32 OS_FowardAngle = #addr ID * 0x0100 + 0x56;
	
	//[i] var_uint8 OS_EventFlag;
	public uint8 OS_EventFlag;
	//[i] event HitEvent;
	//[i] event EageHitEvent;
	//[i] event LeaveEvent;
	
	//[i] event RunUpEvent;
	//[i] event RunDownEvent;
	//[i] event RunLeftEvent;
	//[i] event RunRightEvent;
	
	//[i] event TouchDownEvent;
	///[i] event TouchUpEvent;
	
	//---------------------------------------------------
	//[i] function_void OS_init;
	public void OS_init()
	{
		uint32 t = ID;
		Id = (int)t;
		OS_EventFlag = 0;
	}
	//---------------------------------------------------
	//[i] function_void AddBitmap Cstring;
	public void AddBitmap( [#.code uint16*?] string )
	{
		#.linker.SetString( ID, 0x20, string );
	}
	//---------------------------------------------------
	//[i] function_void Run int32;
	public void Run( int32 n )
	{
		#.linker.SetValue( ID, 0x30, (uint)n );
	}
	//---------------------------------------------------
	//[i] function_void Undo;
	public void Undo()
	{
		#.linker.SetValue( ID, 0x31, 0 );
	}
	//---------------------------------------------------
	//[i] function_void SetText Cstring;
	public void SetText( [#.code uint16*?] string )
	{
		#.linker.SetString( ID, 0x10, string );
	}
	//---------------------------------------------------
	//[i] function_void StopSay;
	public void StopSay()
	{
		#.linker.SetValue( ID, 0x32, 0 );
	}
	//---------------------------------------------------
	//[i] function_void SetID int32;
	public void SetID( int32 i )
	{
		#.linker.SetValue( ID, 0x34, (uint)i );
		Id = i;
	}
	//---------------------------------------------------
	//[i] function_void SetFont Cstring;
	public void SetFont( [#.code uint16*?] string )
	{
		#.linker.SetString( ID, 0x11, string );
	}
	//---------------------------------------------------
	//[i] function_void OS_thread;
	public void OS_thread()
	{
		#.linker.SetValue( ID, 0x33, 0 );
	}
}




