locked
question

    Question

  •  

    1. do you know how i really add my own player like this:

     

     

    2. how i rotate the character from 0 degrees to 180 degrees by editing characters?

    Thursday, June 05, 2008 9:06 PM

Answers

  • Hi cobra - You can upload images as described here: http://www.popflywiki.com/GameCreatorUsingUploadedFiles.ashx

     

    To adjust the rotation, you can either set the rotation property or edit the XAML adding a wrapping canvas and setting the the rotation and center like this:

    Code Snippet

    http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="83" Width="65">
    <Canvas>
      <Canvas.RenderTransform>
        <RotateTransform CenterX="32.5" CenterY="41.5" Angle="90"/>
      </Canvas.RenderTransform>

    ... the stuff that was between the original outer canvas tags

    </Canvas>
    </Canvas>

     

    Make sure you set CenterX and CenterY to half width and height. 

     

    That's if you just want it to statically and always be sideways and all your rotations be relative to that.  If you actually want the "forward" of the actor to still be toward the top of the unrotated actor, just use a rotation behavior or use

    Code Snippet
    this.SetValue("Rotation", 180);

     

     

    in a custom code behavior.

    Thursday, June 05, 2008 11:20 PM

All replies

  • Hi cobra - You can upload images as described here: http://www.popflywiki.com/GameCreatorUsingUploadedFiles.ashx

     

    To adjust the rotation, you can either set the rotation property or edit the XAML adding a wrapping canvas and setting the the rotation and center like this:

    Code Snippet

    http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="83" Width="65">
    <Canvas>
      <Canvas.RenderTransform>
        <RotateTransform CenterX="32.5" CenterY="41.5" Angle="90"/>
      </Canvas.RenderTransform>

    ... the stuff that was between the original outer canvas tags

    </Canvas>
    </Canvas>

     

    Make sure you set CenterX and CenterY to half width and height. 

     

    That's if you just want it to statically and always be sideways and all your rotations be relative to that.  If you actually want the "forward" of the actor to still be toward the top of the unrotated actor, just use a rotation behavior or use

    Code Snippet
    this.SetValue("Rotation", 180);

     

     

    in a custom code behavior.

    Thursday, June 05, 2008 11:20 PM
  • Sorry, for some reason the forum didn't like my entering xml.  Basically, you add a wrapping canvas around the contents of the main canvas in XAML view, then add a Canvas.RenderTransform to rotate centering around the middle of width and height.  See this page for the documentation on how to do so:

    http://msdn.microsoft.com/en-us/library/bb979738(VS.95).aspx

     

    Thursday, June 05, 2008 11:24 PM
  • I find that using Microsoft Expression Blend 2.5 March preview works like a charm. I got this tip first from a speaker at the Microsoft Dev Days in the Netherlands.

     

    You can rotate, animate, scale, change the colour and do tons of nice stuff while using an interface! Now lets hope they will make us a Express version Stick out tongue

     

    http://popflywiki.com/How%20do%20I%20change%20appearance%20of%20an%20existing%20actor.ashx

    Friday, June 06, 2008 7:25 AM
  • Yes, but after i upload my own picture, how i really turn to my own actor without problem like in this picture i uploaded

    Friday, June 06, 2008 11:49 AM
  • Follow the instructions on the wiki here: http://www.popflywiki.com/GameCreatorUsingUploadedFiles.ashx

    (read the whole page).

    Saturday, June 07, 2008 12:59 AM