Spine.SkeletonBounds.AabbContainsPoint C# (CSharp) Method

AabbContainsPoint() public method

Returns true if the axis aligned bounding box contains the point.
public AabbContainsPoint ( float x, float y ) : bool
x float
y float
return bool
		public bool AabbContainsPoint (float x, float y) {
			return x >= minX && x <= maxX && y >= minY && y <= maxY;
		}

Usage Example

Example #1
0
        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, 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);
        }
All Usage Examples Of Spine.SkeletonBounds::AabbContainsPoint