Skip to main content
Home Forums Silverlight Programming Game Development !viewportrect.contains error
2 replies. Latest Post by Bill Reiss on October 18, 2009.
(0)
Spl33n M...
Member
1 points
5 Posts
10-15-2009 4:30 AM |
I get 4 of these errors.
Error 5 'SilverArcade.SilverSprite.Rectangle' does not contain a definition for 'Contains' and no extension method 'Contains' accepting a first argument of type 'SilverArcade.SilverSprite.Rectangle' could be found (are you missing a using directive or an assembly reference?)
if public void UpdateCannonBalls()
{
foreach (GameObject ball in cannonballs)
if (ball.alive)
ball.position += ball.velocity;
if (!viewportRect.Contains(new Point
((int)ball.position.X, (int)ball.position.Y)))
ball.alive = false; continue;
What reference do I add? Theres also 2 errors for resetElapsedTime.
Same error as above only exception is it says SilverArcade.SilverSprite.Rectangle.
Thanks.
mchlsync
Star
14606 points
2,730 Posts
10-15-2009 5:14 AM |
It would be great if you can provide more information. Everyone doesn't know what 'SilverArcade.SilverSprite.Rectangle' is.
Based on your error, it seems like you are using Contains method that doesn't exist in 'SilverArcade.SilverSprite.Rectangle' . So, remove the code that use this Contain method or create an extension method for that.
Bill Reiss
Contributor
4840 points
919 Posts
10-18-2009 8:47 AM |
I have answered this on the SilverSprite discussion forum since it is a SilverSprite and not a Silverlight issue.