xnanimation

XNA game components

一笑奈何 提交于 2019-12-08 02:25:33
问题 I an confused about how to pass values of variables from 1 gamecomponent to another. I am using xna 4.0. I created two gamecomponents, the drawstring and the inputmanager. I want to read the keyboard input of the user and pass it onto drawstring where it will update the position. I cant add components on drawstring(drawablegamecomponent). I can do it on class but not on gamecomponent. Can you guys post some examples here. For beginners. 回答1: Use GameComponent for something that you would want

XNA game components

我的未来我决定 提交于 2019-12-06 06:50:42
I an confused about how to pass values of variables from 1 gamecomponent to another. I am using xna 4.0. I created two gamecomponents, the drawstring and the inputmanager. I want to read the keyboard input of the user and pass it onto drawstring where it will update the position. I cant add components on drawstring(drawablegamecomponent). I can do it on class but not on gamecomponent. Can you guys post some examples here. For beginners. Use GameComponent for something that you would want to have Update called on every frame, and use DrawableGameComponent for something that you would want to