c# - How to move a rectangle in a Canvas? -


if want move rectangle in canvas, have modify top , left properties? thats way see possible. making tile-based game, , rectangles want move filled images of enemies , hero.

you can use rendertransform on rectangle.

<window x:class="wpfapplication2.mainwindow"         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"         title="mainwindow" height="350" width="525">     <canvas>         <rectangle width="10" height="10" fill="red">             <rectangle.rendertransform>                 <translatetransform x="10" y="10"/>             </rectangle.rendertransform>         </rectangle>     </canvas> </window> 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -