/// <summary> /// Creates a new instance of ScreenManager. /// </summary> public ScreenManager(Microsoft.Xna.Framework.Game game, Kinect.Kinect kinect) : base(game) { this.Kinect = kinect; if (Kinect.trackedSkeleton != null) { Constants.posY = Kinect.trackedSkeleton.Joints[JointType.HipCenter].Position.Y; Constants.posZ = Kinect.trackedSkeleton.Joints[JointType.ElbowRight].Position.Z; Constants.elbowPosY = Kinect.trackedSkeleton.Joints[JointType.ElbowRight].Position.Y; Constants.diffHandElbow = Kinect.trackedSkeleton.Joints[JointType.HandRight].Position.Z - Kinect.trackedSkeleton.Joints[JointType.ElbowRight].Position.Z; Constants.HipPosX = Kinect.trackedSkeleton.Joints[JointType.HipCenter].Position.X; } base.Initialize(); }
public void InitializeButtons() { #region Letter Buttons Kinect.Kinect Kinect = this.ScreenManager.Kinect; A = new Button(); B = new Button(); C = new Button(); D = new Button(); E = new Button(); F = new Button(); G = new Button(); H = new Button(); I = new Button(); J = new Button(); K = new Button(); L = new Button(); M = new Button(); N = new Button(); O = new Button(); P = new Button(); Q = new Button(); R = new Button(); S = new Button(); T = new Button(); U = new Button(); V = new Button(); W = new Button(); X = new Button(); Y = new Button(); Z = new Button(); buttons.Add(A); buttons.Add(B); buttons.Add(C); buttons.Add(D); buttons.Add(E); buttons.Add(F); buttons.Add(G); buttons.Add(H); buttons.Add(I); buttons.Add(J); buttons.Add(K); buttons.Add(L); buttons.Add(M); buttons.Add(N); buttons.Add(O); buttons.Add(P); buttons.Add(Q); buttons.Add(R); buttons.Add(S); buttons.Add(T); buttons.Add(U); buttons.Add(V); buttons.Add(W); buttons.Add(X); buttons.Add(Y); buttons.Add(Z); A.Clicked += new Button.ClickedEventHandler(A_Clicked); B.Clicked += new Button.ClickedEventHandler(B_Clicked); C.Clicked += new Button.ClickedEventHandler(C_Clicked); D.Clicked += new Button.ClickedEventHandler(D_Clicked); E.Clicked += new Button.ClickedEventHandler(E_Clicked); F.Clicked += new Button.ClickedEventHandler(F_Clicked); G.Clicked += new Button.ClickedEventHandler(G_Clicked); H.Clicked += new Button.ClickedEventHandler(H_Clicked); I.Clicked += new Button.ClickedEventHandler(I_Clicked); J.Clicked += new Button.ClickedEventHandler(J_Clicked); K.Clicked += new Button.ClickedEventHandler(K_Clicked); L.Clicked += new Button.ClickedEventHandler(L_Clicked); M.Clicked += new Button.ClickedEventHandler(M_Clicked); N.Clicked += new Button.ClickedEventHandler(N_Clicked); O.Clicked += new Button.ClickedEventHandler(O_Clicked); P.Clicked += new Button.ClickedEventHandler(P_Clicked); Q.Clicked += new Button.ClickedEventHandler(Q_Clicked); R.Clicked += new Button.ClickedEventHandler(R_Clicked); S.Clicked += new Button.ClickedEventHandler(S_Clicked); T.Clicked += new Button.ClickedEventHandler(T_Clicked); U.Clicked += new Button.ClickedEventHandler(U_Clicked); V.Clicked += new Button.ClickedEventHandler(V_Clicked); W.Clicked += new Button.ClickedEventHandler(W_Clicked); X.Clicked += new Button.ClickedEventHandler(X_Clicked); Y.Clicked += new Button.ClickedEventHandler(Y_Clicked); Z.Clicked += new Button.ClickedEventHandler(Z_Clicked); A.Initialize("Buttons/A", Kinect, new Vector2(317, 270)); B.Initialize("Buttons/B", Kinect, new Vector2(A.Position.X + 80, A.Position.Y)); C.Initialize("Buttons/C", Kinect, new Vector2(B.Position.X + 80, A.Position.Y)); D.Initialize("Buttons/D", Kinect, new Vector2(C.Position.X + 80, A.Position.Y)); E.Initialize("Buttons/E", Kinect, new Vector2(D.Position.X + 80, A.Position.Y)); F.Initialize("Buttons/F", Kinect, new Vector2(E.Position.X + 80, A.Position.Y)); G.Initialize("Buttons/G", Kinect, new Vector2(F.Position.X + 80, A.Position.Y)); H.Initialize("Buttons/H", Kinect, new Vector2(G.Position.X + 80, A.Position.Y)); I.Initialize("Buttons/I", Kinect, new Vector2(H.Position.X + 80, A.Position.Y)); J.Initialize("Buttons/J", Kinect, new Vector2(A.Position.X, A.Position.Y + 100)); K.Initialize("Buttons/K", Kinect, new Vector2(A.Position.X + 80, J.Position.Y)); L.Initialize("Buttons/L", Kinect, new Vector2(B.Position.X + 80, J.Position.Y)); M.Initialize("Buttons/M", Kinect, new Vector2(C.Position.X + 80, J.Position.Y)); N.Initialize("Buttons/N", Kinect, new Vector2(D.Position.X + 80, J.Position.Y)); O.Initialize("Buttons/O", Kinect, new Vector2(E.Position.X + 80, J.Position.Y)); P.Initialize("Buttons/P", Kinect, new Vector2(F.Position.X + 80, J.Position.Y)); Q.Initialize("Buttons/Q", Kinect, new Vector2(G.Position.X + 80, J.Position.Y)); R.Initialize("Buttons/R", Kinect, new Vector2(H.Position.X + 80, J.Position.Y)); S.Initialize("Buttons/S", Kinect, new Vector2(J.Position.X + 40, J.Position.Y + 100)); T.Initialize("Buttons/T", Kinect, new Vector2(S.Position.X + 80, S.Position.Y)); U.Initialize("Buttons/U", Kinect, new Vector2(T.Position.X + 80, S.Position.Y)); V.Initialize("Buttons/V", Kinect, new Vector2(U.Position.X + 80, S.Position.Y)); W.Initialize("Buttons/W", Kinect, new Vector2(V.Position.X + 80, S.Position.Y)); X.Initialize("Buttons/X", Kinect, new Vector2(W.Position.X + 80, S.Position.Y)); Y.Initialize("Buttons/Y", Kinect, new Vector2(X.Position.X + 80, S.Position.Y)); Z.Initialize("Buttons/Z", Kinect, new Vector2(Y.Position.X + 80, S.Position.Y)); #endregion }
public void Initialize(Kinect.Kinect kinect) { this.kinect = kinect; }