protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.Black); state.Update(gameTime.ElapsedGameTime.Milliseconds / 1000f); state.Apply(skeleton); skeleton.UpdateWorldTransform(); skeletonRenderer.Begin(); skeletonRenderer.Draw(skeleton); skeletonRenderer.End(); bounds.Update(skeleton); MouseState mouse = Mouse.GetState(); if (bounds.AabbContainsPoint(mouse.X, mouse.Y)) { BoundingBoxAttachment hit = bounds.ContainsPoint(mouse.X, mouse.Y); if (hit != null) { headSlot.G = 0; headSlot.B = 0; } else { headSlot.G = 1; headSlot.B = 1; } } base.Draw(gameTime); }
protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.Black); state.Update(gameTime.ElapsedGameTime.Milliseconds / 1000f); state.Apply(skeleton); skeleton.UpdateWorldTransform(); skeletonRenderer.Begin(); skeletonRenderer.Draw(skeleton); skeletonRenderer.End(); base.Draw(gameTime); }
/// <summary> /// Drawed den Package-Inhalt /// </summary> /// <param name="pSpriteBatch">SpriteBatch zum drawen von Texturen</param> /// <param name="pSkeletonRenderer">SkeletonRenderer zum drawen von Texturen</param> public void Draw(SpriteBatch pSpriteBatch, SkeletonRenderer pSkeletonRenderer) { if (!Spine) { pSpriteBatch.Draw(mTexture, mPosition, new Color(mAlpha, mAlpha, mAlpha, mAlpha)); } else { pSkeletonRenderer.Begin(); pSkeletonRenderer.Draw(mSkeleton); pSkeletonRenderer.End(); } if (EngineSettings.IsDebug) pSpriteBatch.Draw(TextureManager.Instance.GetElementByString("pixel"), mCollisionBox, mDebugColor); }
protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.Black); state.Update(gameTime.ElapsedGameTime.Milliseconds / 1000f); state.Apply(skeleton); skeleton.UpdateWorldTransform(); if (skeletonRenderer.Effect is BasicEffect) { ((BasicEffect)skeletonRenderer.Effect).Projection = Matrix.CreateOrthographicOffCenter(0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height, 0, 1, 0); } else { skeletonRenderer.Effect.Parameters["Projection"].SetValue(Matrix.CreateOrthographicOffCenter(0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height, 0, 1, 0)); } skeletonRenderer.Begin(); skeletonRenderer.Draw(skeleton); skeletonRenderer.End(); skeletonDebugRenderer.Effect.Projection = Matrix.CreateOrthographicOffCenter(0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height, 0, 1, 0); skeletonDebugRenderer.Begin(); skeletonDebugRenderer.Draw(skeleton); skeletonDebugRenderer.End(); bounds.Update(skeleton, true); MouseState mouse = Mouse.GetState(); if (headSlot != null) { headSlot.G = 1; headSlot.B = 1; if (bounds.AabbContainsPoint(mouse.X, mouse.Y)) { BoundingBoxAttachment hit = bounds.ContainsPoint(mouse.X, mouse.Y); if (hit != null) { headSlot.G = 0; headSlot.B = 0; } } } base.Draw(gameTime); }