WP7 游戏 - 当方向改变时仅旋转一些控件
我正在制作一个简单的 WP7 游戏,但在方向改变方面遇到了一些问题。我的游戏板如下所示:
当方向改变时,我只需要旋转数字。有什么简单的方法可以做到吗?数字是文本块,线条是矩形。游戏板是画布(但我也可以使用网格)。
或者我可以将画布排除在自动旋转之外,只重新绘制数字。但我也不知道该怎么做。
I'm making a simple WP7 game and I have a little problem with orientation changing. My gameboard looks like this:
And I need to rotate only the numbers when orientation changed. Is there any easy way to do it? The numbers are TextBlocks and lines are rectangles. Gameboard is Canvas (but I can use Grid as well).
Or i could exclude the canvas from automatic rotating and only redraw the numbers. But I don't know how to do it either.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
PlaneProjection
应该没问题:显然这会立即应用投影,因此您需要在代码中创建它(或尝试使用
0
作为Z< /代码>值,然后根据提供的数据(以及内部)在代码中更改该值(这种可能性不大)) phone.controls.phoneapplicationpage.orientationchanged%28v=vs.92%29.aspx" rel="nofollow">
OriationChanged
事件处理程序,例如:Using
PlaneProjection
should be fine:Obviously this would apply the projection immediately, so you would need to create it in code (or try using
0
for theZ
value and then changing that in code (possibility of this is a long shot)) based on the data provided (and within) theOrienationChanged
event handler, such as: