我尝试获取网格的高度和宽度:
int numberOfColumnsInGameView = (int)(gameView.Width / objectSize);
int numberOfRowsInGameView = (int)(gameView.Height / objectSize -0.5);
gameView
网格在哪里。当我尝试分配给变量时,我有那个var =NaN
我建议您使用Grid.ActualHeight
和Grid.ActualWidth
属性。仅当需要设置新值时Height
,Width
才应使用和。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句