Jump to content

Class MoveImageBox


Recommended Posts

  • Bronze

M2 Download Center

This is the hidden content, please
( Internal )

New class used in official servers for minigameokey (move cards).

Code can be improved, who have a better code please make a new topic. No one is forced to use my code.

This is the hidden content, please

Screen (Shang) : pomZ7_LWTOiiYypGKneM0w.gif

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 13
  • Good 1
  • Love 11
Link to comment
Share on other sites

  • Bronze
hace 34 minutos, ragem0re dijo:

published long time ago:

 

or is there any improvement?

 

What Ken published is nothing.

 

hace 50 minutos, Exygo dijo:

What does this do?

This is what it does: 

tKhTZiIwTom5_remGkyx2w.png

This is only a rendering of an image, published by Mijago with FineListBox for his last switchbot.

Spoiler

This is what I mean with Mijago's FineListBox:

2e9071062b684c898ed968880d96c8eb.gif

This is what it does:

Spoiler

pomZ7_LWTOiiYypGKneM0w.gif

Otherwise thanks for the release.

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

Okay xD yours might be a bit better mine after some reverse engineering looked more like this

 

	void CMoveImageBox::SetMovePosition (float x, float y)
	{
		if (x == m_vec2TargetPos.x)	{
			return;
		}

		if (x == m_vec2TargetPos.y)	{
			return;
		}

		if (m_rect.top == m_vec2StartingPos.x) {
			return;
		}

		if (m_rect.right == m_vec2StartingPos.y) {
			return;
		}

		m_vec2StartingPos.x = m_rect.top;
		m_vec2StartingPos.y = m_rect.right;

		m_vec2TargetPos.x = x;
		m_vec2TargetPos.y = y;

		m_vec2NormalizedPos.x = m_vec2TargetPos.x - m_vec2StartingPos.x;
		m_vec2NormalizedPos.y = m_vec2TargetPos.y - m_vec2StartingPos.y;

		m_fMoveDist = m_vec2NormalizedPos.y * m_vec2NormalizedPos.y	+
					  m_vec2NormalizedPos.x * m_vec2NormalizedPos.x;

		D3DXVec2Normalize (&m_vec2NormalizedPos, &m_vec2NormalizedPos);


		if (m_pImageInstance && (m_vec2StartingPos.x != m_vec2NextMovePos.x	|| m_vec2StartingPos.y != m_vec2NextMovePos.y))
		{
			float fDist = sqrt (m_vec2DistanceFromStart.y * m_vec2DistanceFromStart.y +
								m_vec2DistanceFromStart.x * m_vec2DistanceFromStart.x);

			m_vec2NextMovePos.x = m_vec2NormalizedPos.x * fDist;
			m_vec2NextMovePos.y = m_vec2NormalizedPos.y * fDist;

			m_pImageInstance->SetPosition (m_vec2NextMovePos.x, m_vec2NextMovePos.y);
		}

	}

 

Link to comment
Share on other sites

  • 2 years later...
  • Management
Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.