Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - ashutosh sharma

Pages: [1]
1
chat / How to Enable or Disable a FlxButton?
« on: Sat, Sep 20, 2014 »
Hi Everyone...

I have a very simple question.. How can I disable or enable a FlxButton in FlxState as required in my game?

2
Hi Everyone...

I have been reading posts in the forum for last few months.. Thanks for all the help.

I have got myself into a big problem here, were i want to rotate a FlxSprite object in a circle(The object itself is a rectangle of 70*130), Now I want that object to rotate with an angle made by the center and the point where the mouse is placed within its radius. The code i Have used is like this..

Here I loaded the image:

loadRotatedGraphic("img/Ship.gif", 32, -1, true, true);

And here am i trying to rotate the image

if (FlxG.mouse.pressed)
      {
         var mouse_pos:FlxPoint = new FlxPoint(FlxG.mouse.x, FlxG.mouse.y);
         if (mouse_x>center.x && mouse_x < (center.x + width/2) && mouse_y < (center.y +height/2) &&mouse_y > center.y)
         {
            
            angularVelocity -= (FlxAngle.getAngle(getMidpoint(), arrow_end) -  FlxAngle.getAngle(getMidpoint(), mouse_pos));   
         }
         arrow_end = mouse_pos;
         
      }


Can anyone please help me with it because this code is not working, whenever i am placing the mouse in the area the object is rotating in a single direction and is not going to that point.

Pages: [1]