rotate actor image based on key press

echoinkechoink Member Posts: 11
edited December 2013 in Working with GS (Mac)
I have attempted to constrain attribute changed to various angles to no avail. The change attribute, graphics, flip horizontally, when I click the left arrow and flip horizontally when I flip the right arrow, but I can't get the graphic to turn 90 degress to the right (downward when I press the down arrow). Nor can I get it to face up when I press the up key.

When I set the down arrow to

Move in direction 270 relative to actor in an additive way
speed 300
constrain self.rotation to vectorToAngle(270,270)

constrain self.rotation to vectorToAngle(0,270)

constrain self.rotation to vectorToAngle(270,0)

the actor moves at a 45 degree downward angle and the graphic aims upward.

Comments

  • AppTacoAppTaco Member Posts: 125
    If I understand your question, if the actor goes left change rotation to 180. If up, change it to 90. If down, change it to 270.
  • bjandthekatzbjandthekatz Orlando, FlMember Posts: 1,375
    Constrain VectorToAngle(Self.Motion.Linearvelocity.X, Self.Motion.LinearvelocityY)
  • echoinkechoink Member Posts: 11
    edited December 2013
    I had the constrain vector attribute set ... the actor was spinning like a roulette table. The key to all this was "relative to scene." Seems to work now.

  • Abigail111Abigail111 Member Posts: 5
    Hi there
    If i have understand your question,you are trying to rotate your image.For me ,i usually rotate the image using this code:
    namespace RE__Test
    {
    public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {
    string fileName = "c:/Sample.png";

    REImage reImage = REFile.OpenImageFile(fileName);

    ImageProcessing.Apply Image Rotate(reImage, 60);

    REFile.SaveImageFile(reImage, "c:/reimage.png", new PNGEncoder());
    }
    }
    It supports to rotate the image as you wish.You can have a try.
  • bjandthekatzbjandthekatz Orlando, FlMember Posts: 1,375
    @Abigail111 This is a drag and drop program. It does not support external snippets.
Sign In or Register to comment.