Jump to content
Maintenance ×
×
×
  • Create New...

Class MoveImageBox


Recommended Posts

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.

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...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


  • Activity

    1. 0

      erorrs after update granny to 2.9

    2. 0

      Navicat Premium 16.1.1 x64

    3. 5

      problem Dargon Soul Changre Attribute

    4. 5

      problem Dargon Soul Changre Attribute

    5. 41

      Global Chat

    6. 5

      problem Dargon Soul Changre Attribute

    7. 2

      Startup Loading Window Library

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.