GrandLarceny.Button.move C# (CSharp) Method

move() public method

public move ( Vector2 a_moveLength ) : void
a_moveLength Vector2
return void
        public void move(Vector2 a_moveLength)
        {
            m_position.plusWith(a_moveLength);
            m_bounds.X = (int)(m_position.getLocalX() + Game.getInstance().getResolution().X / 2);
            m_bounds.Y = (int)(m_position.getLocalY() + Game.getInstance().getResolution().Y / 2);
            if (m_text != null)
            {
                m_text.move(a_moveLength);
                if (this is TextButton)
                {
                    m_bounds = m_text.getBox();
                    m_bounds.X += (int)Game.getInstance().getResolution().X / 2;
                    m_bounds.Y += (int)Game.getInstance().getResolution().Y / 2;
                }
            }
        }

Usage Example

Esempio n. 1
0
 public void addEvent(Button a_care)
 {
     a_care.move(new Vector2(0, 25));
     m_eventsToAdd.Push(new Event(new LinkedList<EventTrigger>(), new LinkedList<EventEffect>(), true));
 }
All Usage Examples Of GrandLarceny.Button::move